machine learning code in Python