  Nowadays, Machine Learning techniques offer fast and efficient solutions for
classification problems that would require intensive computational resources
via traditional methods. We examine the use of a supervised Random Forest to
classify stars in simulated galaxy clusters after subtracting the member
galaxies. These dynamically different components are interpreted as the
individual properties of the stars in the Brightest Cluster Galaxy (BCG) and
IntraCluster Light (ICL). We employ matched stellar catalogues (built from the
different dynamical properties of BCG and ICL) of 29 simulated clusters from
the DIANOGA set to train and test the classifier. The input features are
cluster mass, normalized particle cluster-centric distance, and rest-frame
velocity. The model is found to correctly identify most of the stars, while the
larger errors are exhibited at the BCG outskirt, where the differences between
the physical properties of the two components are less obvious. We investigate
the robustness of the classifier to numerical resolution, redshift dependence
(up to $z=1$), and included astrophysical models. We claim that our classifier
provides consistent results in simulations for $z<1$, at different resolution
levels and with significantly different subgrid models. The phase-space
structure is examined to assess whether the general properties of the stellar
components are recovered: (i) the transition radius between BCG-dominated and
ICL-dominated region is identified at $0.04$ \r200; (ii) the BCG outskirt ($>
0.1$ \r200) is significantly affected by uncertainties in the classification
process. In conclusion, this work suggests the importance of employing Machine
Learning to speed up a computationally expensive classification in simulations.
