Cosmology in the machine learning era