machine learning snippets