python script, based on scikit learn