  Understanding the impact of halo properties beyond halo mass on the
clustering of galaxies (namely galaxy assembly bias) remains a challenge for
contemporary models of galaxy clustering. We explore the use of machine
learning to predict the halo occupations and recover galaxy clustering and
assembly bias in a semi-analytic galaxy formation model. For stellar-mass
selected samples, we train a Random Forest algorithm on the number of central
and satellite galaxies in each dark matter halo. With the predicted
occupations, we create mock galaxy catalogues and measure the clustering and
assembly bias. Using a range of halo and environment properties, we find that
the machine learning predictions of the occupancy variations with secondary
properties, galaxy clustering and assembly bias are all in excellent agreement
with those of our target galaxy formation model. Internal halo properties are
most important for the central galaxies prediction, while environment plays a
critical role for the satellites. Our machine learning models are all provided
in a usable format. We demonstrate that machine learning is a powerful tool for
modelling the galaxy-halo connection, and can be used to create realistic mock
galaxy catalogues which accurately recover the expected occupancy variations,
galaxy clustering and galaxy assembly bias, imperative for cosmological
analyses of upcoming surveys.
