Some machine learning algorithms in javascript