implementations of some machine learning algorithms