Star formation rates for photometric samples of galaxies using machine learning methods