solutions for a few machine learning algorithms