Real-time machine learning algorithms