using python to implement some machine learning algorithm