self machine learning practice code