A machine learning approach to galaxy properties: Joint redshift-stellar mass probability distributions with Random Forest

S. Mucesh, W. G. Hartley, A. Palmese, O. Lahav, L. Whiteway, A. F.L. Bluck, A. Alarcon, A. Amon, K. Bechtol, G. M. Bernstein, A. Carnero Rosell, M. Carrasco Kind, A. Choi, K. Eckert, S. Everett, D. Gruen, R. A. Gruendl, I. Harrison, E. M. Huff, N. KuropatkinI. Sevilla-Noarbe, E. Sheldon, B. Yanny, M. Aguena, S. Allam, D. Bacon, E. Bertin, S. Bhargava, D. Brooks, J. Carretero, F. J. Castander, C. Conselice, M. Costanzi, M. Crocce, L. N. Da Costa, M. E.S. Pereira, J. De Vicente, S. Desai, H. T. Diehl, A. Drlica-Wagner, A. E. Evrard, I. Ferrero, B. Flaugher, P. Fosalba, J. Frieman, J. García-Bellido, E. Gaztanaga, D. W. Gerdes, J. Gschwend, G. Gutierrez, S. R. Hinton, D. L. Hollowood, K. Honscheid, D. J. James, K. Kuehn, M. Lima, H. Lin, M. A.G. Maia, P. Melchior, F. Menanteau, R. Miquel, R. Morgan, F. Paz-Chinchón, A. A. Plazas, E. Sanchez, V. Scarpine, M. Schubnell, S. Serrano, M. Smith, E. Suchyta, G. Tarle, D. Thomas, C. To, T. N. Varga, R. D. Wilkinson

Research output: Contribution to journalArticlepeer-review


We demonstrate that highly accurate joint redshift-stellar mass probability distribution functions (PDFs) can be obtained using the Random Forest (RF) machine learning (ML) algorithm, even with few photometric bands available. As an example, we use the Dark Energy Survey (DES), combined with the COSMOS2015 catalogue for redshifts and stellar masses. We build two ML models: one containing deep photometry in the griz bands, and the second reflecting the photometric scatter present in the main DES survey, with carefully constructed representative training data in each case. We validate our joint PDFs for 10 699 test galaxies by utilizing the copula probability integral transform and the Kendall distribution function, and their univariate counterparts to validate the marginals. Benchmarked against a basic set-up of the template-fitting code bagpipes, our ML-based method outperforms template fitting on all of our predefined performance metrics. In addition to accuracy, the RF is extremely fast, able to compute joint PDFs for a million galaxies in just under 6 min with consumer computer hardware. Such speed enables PDFs to be derived in real time within analysis codes, solving potential storage issues. As part of this work we have developed galpro1, a highly intuitive and efficient python package to rapidly generate multivariate PDFs on-the-fly. galpro is documented and available for researchers to use in their cosmology and galaxy evolution studies.

Original languageEnglish (US)
Pages (from-to)2770-2786
Number of pages17
JournalMonthly Notices of the Royal Astronomical Society
Issue number2
StatePublished - Apr 1 2021


  • galaxies: evolution
  • galaxies: fundamental parameters
  • methods: data analysis
  • methods: statistical
  • software: data analysis
  • software: public release

ASJC Scopus subject areas

  • Astronomy and Astrophysics
  • Space and Planetary Science


Dive into the research topics of 'A machine learning approach to galaxy properties: Joint redshift-stellar mass probability distributions with Random Forest'. Together they form a unique fingerprint.

Cite this