  We propose a random forest (RF) machine learning approach to determine the
accreted stellar mass fractions ($f_\mathrm{acc}$) of central galaxies, based
on various dark matter halo and galaxy features. The RF is trained and tested
using 2,710 galaxies with stellar mass $\log_{10}M_\ast/M_\odot>10.16$ from the
TNG100 simulation. Galaxy size is the most important individual feature when
calculated in 3-dimensions, which becomes less important after accounting for
observational effects. For smaller galaxies, the rankings for features related
to merger histories increase. When an entire set of halo and galaxy features
are used, the prediction is almost unbiased, with root-mean-square error (RMSE)
of $\sim$0.068. A combination of up to three features with different types
(galaxy size, merger history and morphology) already saturates the power of
prediction. If using observable features, the RMSE increases to $\sim$0.104,
and a combined usage of stellar mass, galaxy size plus galaxy concentration
achieves similar predictions. Lastly, when using galaxy density, velocity and
velocity dispersion profiles as features, which approximately represent the
maximum amount of information extracted from galaxy images and velocity maps,
the prediction is not improved much. Hence the limiting precision of predicting
$f_\mathrm{acc}$ is $\sim$0.1 with observables, and the multi-component
decomposition of galaxy images should have similar or larger uncertainties. If
the central black hole mass and the spin parameter of galaxies can be
accurately measured in future observations, the RMSE is promising to be further
decreased by $\sim$20%.
