Application of machine learning for production optimization