  We present the ROGER (Reconstructing Orbits of Galaxies in Extreme Regions)
code, which uses three different machine learning techniques to classify
galaxies in, and around, clusters, according to their projected phase-space
position. We use a sample of 34 massive, $M_{200}>10^{15} h^{-1} M_{\odot}$,
galaxy clusters in the MultiDark Planck 2 (MDLP2) simulation at redshift zero.
We select all galaxies with stellar mass $M_{\star} \ge 10^{8.5}
h^{-1}M_{\odot}$, as computed by the semi-analytic model of galaxy formation
SAG, that are located in, and in the vicinity of, the clusters and classify
them according to their orbits. We train ROGER to retrieve the original
classification of the galaxies out of their projected phase-space positions.
For each galaxy, ROGER gives as output the probability of being a cluster
galaxy, a galaxy that has recently fallen into a cluster, a backsplash galaxy,
an infalling galaxy, or an interloper. We discuss the performance of the
machine learning methods and potential uses of our code. Among the different
methods explored, we find the K-Nearest Neighbours algorithm achieves the best
performance.
