My exercise in machine learning course