Machine learning algorithms for flow modeling and control