Useful code to learn machine learning