WorksPhysics and Astronomy
Cross-Dataset Inference of Central-Satellite Classification and Host Halo Masses from Galaxy neighbours with Machine Learning
Abstract
The classification of galaxies as centrals or satellites gives insight into the galaxy-halo connection. This, together with halo mass estimates, can be used to connect observed galaxy populations to underlying dark matter structure. To (1) classify galaxies as centrals or satellites and (2) estimate the host halo mass for centrals, we train XGBoost models on IllustrisTNG (TNG100) galaxies, using the distances (3D or projected (2+1)D redshift space) and of their ten nearest neighbours. We then test the model on EAGLE to measure its robustness after applying a simple domain-alignment step that corrects for a relative shift in the distribution between TNG100 and EAGLE. We further augment the training data by combining feature sets from neighbour samples with varying lower thresholds. On the TNG100 test set, the central/satellite classifier reaches purity and completeness (0.95) in 3D (projected redshift) space at the threshold where purity=completeness, and the halo-mass regressor achieves =0.98 (0.93) when evaluated on true centrals and (0.93) when evaluated on inferred centrals. Applied to EAGLE after alignment, the classifier achieves purity/completeness (0.95), while halo-mass inference yields () for true centrals and (0.77) for inferred centrals; training-data augmentation most improves the halo-mass estimation task. Satellites misclassified as centrals underpredict the true masses of host halos, especially if they are closer to a lower mass halo's central than its own host's central and/or has a significantly lower than its own central. These results show that survey-accessible information such as projected separations and stellar masses - combined with simulation-trained models and domain alignment - can enable reliable central identification and host halo mass estimation to an .
Introduction
In the CDM model, structure formation occurs hierarchically. Galaxies form within dark matter potential wells, where baryonic matter is gravitationally pulled into dark matter overdensities and subsequently cools and collapses, while the surrounding dark matter structure evolves into a virialized halo ([39] (Navarro et al. 1996)). As a result, galaxies merge and evolve in tandem with their host halos. This eventually becomes a structure where multiple galaxies, known as satellites, occupy the halo of the gravitationally dominant galaxy of that halo, known as a central ([28, 14, 6, 24, 37]). Because central galaxies formed and evolved with their host halos, their properties should have the stronger correlations with the host halo mass [21, 7, 10, 16]. Being able to classify galaxies as centrals or satellites can then be useful when trying to determine environment (e.g., see Bowden & Behroozi [9], for a recent discussion) and mass of the host halo, the latter which primarily consists of dark matter. The host halo mass can then be used to construct the halo mass function and density profiles [14, 4, 35], which are sensitive to cosmology and can be a probe of cosmological parameters.
In observations it is often unclear how to distinguish a satellite galaxy from a central, as the underlying host halo is made mostly of dark matter and thus unobservable. Central and satellite galaxies often have different properties, as satellites form outside the present central’s host halo and fall into the halo at a later time. Thus, they are subject to the ram pressure, harassment, and tidal forces of the host halo and its central, whereas the central galaxy would be significantly less subject to these processes. Consequently, satellite galaxies would have different formation histories compared to those of central galaxies.
Here, we aim to develop a method to identify central galaxies, building upon the results of Oguri & Lin [27], where the mass of the underlying host halo of a given galaxy can be determined based on its number of nearest neighbours within some fixed cylindrical radii; the optimal cylindrical radius for this is found to be . From their results and Figure 1, it can be seen that spatial clustering of neighbours around each galaxy can be a method used to distinguish between centrals and satellites, as their neighbouring galaxy distribution curves differ from each other. This difference in neighbouring galaxy distribution can be used to determine whether a galaxy is a central or a satellite. In most previous works, centrals were often identified using stellar mass and luminosity (e.g see, [40, 41], for a reference for observational analyses). However, the brightest galaxy is not necessarily the central, as seen in Skibba et al. [33]. Consequently, we add stellar mass into our classification training data alongside the neighbouring distances, since that is observationally available, but we do not make prior assumptions about the stellar mass or luminosity of the galaxy and its classification. The goal is utilising both to yield more accurate central classification than what has been done before.

Figure 1. a) (Top) Total number of galaxies per radial bin, in 3D distance bins. The radial profiles are stacked for either centrals or satellites in the same host halo mass bin: . The galaxy radial distribution around centrals is distinct from those of satellites. It should be noted that for cluster sized halos, in the right most panel, . TNG100 only had 17 of these objects. b) (Bottom) The stellar mass distribution of galaxies in central galaxies vs satellites, and all galaxies (satellites + centrals). It can be seen that centrals have a peak at around , while satellite with higher stellar masses continuously decrease. This shows a stellar mass gap between centrals and satellites, which leads to a magnitude gap in observations.
In this work, we used data from the Illustris-TNG simulations ([34, 26]) to train XGBoost models to classify galaxies as centrals and satellites, and to perform host halo mass estimations for identified centrals. In section 2, we describe the simulation data used, including the EAGLE simulation ([29]), which we use as a hold-out test dataset for model evaluation. We also briefly describe the XGBoost machine learning algorithm, our input feature selection, and experiments for model training. In section 3, we show results of classification and host halo mass estimation from feature subsets that include neighbour galaxy distances and stellar masses. We also present results when the method is applied to the EAGLE simulation, whose galaxy formation model is distinct from that implemented to produce TNG. In section 4, we provide interpretations of our results in the context of other work, describe potential benefits of our approach, in addition to some limitations. Finally, in section 5, we summarize this paper and outline some future prospects.
Data and Methodology
Simulation Data: Illustris-TNG and EAGLE
Our analysis uses data from the publicly available Illustris-TNG ([26, 34]) and EAGLE cosmological simulation suites ([29]). Specifically, we focus on the TNG100 simulation and EAGLE RefL0100N1504. These simulations provide comparable volumes (110 Mpc vs. 100 Mpc) and mass resolutions, with similar numbers of gas and dark matter particles. While TNG100 adopts a Planck 2015 cosmology (Ade et al. 2016) and EAGLE adopts a Planck 2013 cosmology ([2]), both simulations produce similar galaxy stellar mass and host halo mass distributions.
In both public catalogs, we identify the FoF halos and SUBFIND subhalos. In the TNG group catalog, the relevant fields are GroupMass, corresponding to the total FoF group mass, GroupFirstSub for identifying the central, SubhaloFlag for removal of non-cosmological fragments1, SubhaloPos for co-moving position in , and the stellar component of SubhaloMassType. In the analogous EAGLE catalogue, GroupMass corresponds to the total Friends-of-Friends (FOF) mass of this halo, SubGroupNumber, Flag, Cartesian coordinates, velocities, and MassType_Star ([22, 26]).
The analyses we report here use the snapshots at (). The lengths used to calculate distance are in units of , while the mass is in units of . The EAGLE catalog stores positions in and masses in ; for distance calculations its positions were multiplied by , so the 100-Mpc box spans approximately . The two simulations were therefore compared using distances in and masses in .
To ensure that our sample consists of well-resolved galaxies that would be observable in real surveys, we impose a stellar mass cut of , since galaxies below this cut consist of less than 1000 stellar mass particles and likely do not behave the same way physical galaxies in observations do. Galaxies flagged by the simulations as unphysical are removed from the sample as well. We additionally subselect galaxies to have host halo masses of . This is to preserve a group halo environment for the galaxies to reside in ([17]), so that each halo would have at least satellite ([20]). The galaxies themselves were also further subselected to follow the standard stellar-to-halo mass relation - objects with non-standard stellar mass fractions () are excluded. This is because we cannot distinguish between numerical resolution effects or physical formation anomalies for galaxies having an irregular stellar-to-halo mass, so we exclude these galaxies to minimize the possibility of numerical artifacts.
Our fiducial sample adopts a stellar mass cut of . However, observational galaxy catalogues often employ different stellar mass limits due to survey depth and resolution limitations. To investigate the robustness of our methods to these selection effects, we additionally combine samples constructed from varying the lower limit of stellar mass. Throughout this work, true centrals and satellites are assigned using the subhalo classifications given by the simulation. Central galaxies are defined as the primary galaxy residing at the centre of a host halo, while satellites are all other remaining galaxies gravitationally bound to the host halo. We use the galaxies’ stellar masses and neighbouring distances to get as close to the actual galaxy classification as possible. The lower panel of Figure 1 compares the stellar mass distributions of the selected TNG100 and EAGLE samples. Due to differences in subgrid physics and stellar formation models, there are discrepancies between the stellar mass functions of the two simulations.
To account for this, we applied an empirical stellar mass domain alignment to TNG100 in order to better match the stellar mass distribution of EAGLE. Figure 2 shows the ratio of original stellar mass functions from before and after applying the domain alignment. This prefactor was determined by minimizing the difference between the cumulative stellar mass distributions of the two simulations. We constructed empirical cumulative distribution functions (CDFs) of the stellar masses and evaluated their agreement using a Kolmogorov-Smirnov (KS) statistic, then selected an optimal prefactor as the value that minimized the KS distance between the two CDFs. This procedure is intended to emulate the calibration process that would be required when applying our methodology to observational catalogues, where differences in stellar mass estimates between surveys are common and often require empirical corrections before samples can be combined.
Figure 2. Stellar mass ratio differences between TNG and EAGLE. Due to differences in galaxy formation models, the EAGLE stellar mass function is systematically lower except at the very high stellar mass ends, likely because EAGLE uses a higher . Dividing EAGLE stellar masses by a factor of 0.91 minimizes the difference in distributions using the KS test. The shaded area shows the 1- Poisson error.
When training and testing on TNG, we use a 75:25 random galaxy split: 75% of the sample become our training set, while the remaining 25% is the testing set. We note that some neighbours of training set galaxies may also be neighbours of the test set galaxies. However, it is only the neighbour stellar mass that is redundant, and the neighbour distances capture the actual environment are distinct. So, we do not consider this to be a source of leakage between the training and testing sets. When training on TNG and testing on EAGLE, we take the entire TNG set of selected galaxies for training, and the set of selected EAGLE galaxies for testing. In this case, there are no overlapping galaxies or host halos at all in either training or testing.
XGBoost Classification and Halo Mass Estimation
For our analysis, we used the Extreme Gradient Boosting (XGBoost) algorithm [13]. XGBoost is an ensemble machine learning method based on gradient-boosted decision trees and is widely used due to its computational efficiency, robustness to complex nonlinear relationships, and strong predictive performance across a broad range of applications. Given these strengths, and the fact that it would take a multilayer neural network with heavier computational efforts to obtain similar results (see Table 4, where XGBoost had the best performance), we decided to use XGBoost as our main classifying and regression tool here.
| Method | Quantile Transformed? | Distance only AUC | Distances + AUC |
| Logistic Regression | No | 0.83 | 0.91 |
| Logistic Regression | Yes | 0.97 | 0.97 |
| Neural Nets | No | 0.5 | 0.90 |
| Neural Nets | Yes | 0.99 | 0.90 |
| XGBoost | No | 0.93 | 1.0 |
| XGBoost | Yes | 0.99 | 1.0 |
Table 4. AUC values for the ROC curves corresponding to different models trained with different features to predict central vs. satellite classification.
XGBoost was trained to distinguish between central and satellite galaxies using the distances and stellar masses from the sub-samples described above. For host halo mass estimation, the algorithm is trained as a regression model that predicts the mass of a galaxy’s host halo from the same set of input features. Hyperparameters were optimized using cross-validation on the training set. We also tested logistic regression and a two-layer neural network as alternative classification models, but they consistently produced lower classification and mass estimation accuracy compared to XGBoost (see Table 4).
Feature Selection
We explored subsets of input features motivated by both observational accessibility and theoretical correlation with the galaxy type and host halo mass. These included nearest-neighbour distances, neighbouring galaxy stellar masses, and the stellar mass of the target galaxy itself.
To assess the robustness of our results to observational selection effects, feature selection was repeated for samples defined by different stellar mass cuts. The stellar mass cut was also included as an additional training parameter when the training set combined varying stellar mass cuts together. We found that models trained using multiple stellar mass cut samples consistently outperformed those trained using a single fiducial selection, likely because there are more galaxies to train on. This finding indicates that information from galaxies spanning a range of varying stellar mass cuts provides additional
constraints on halo mass and galaxy type.
We present the results for two sets of training distances: 3D spatial distance in and (2+1)D red-shift space distance. The redshift space distance is calculated as the 2D projected distance in , with an additional redshift training component estimated as , where is the difference in the galaxies’ z-direction velocity, and is the Hubble constant, and is the different in the galaxies z-direction distance. We further constrained the z—axis distance to be to prevent finding “neighbours” that seem close in the 2D plane, but are actually very far from each other in the z—direction. This is a closer proxy to what we would observe in observations, since objects are observed in redshift space, not 3D real space.
We also experimented with training based on galaxy properties that were quantile transformed ([15]). This procedure maps each feature to a target distribution based on its cumulative rank ordering, reducing the influence of extreme outliers and highly skewed distributions. However, we found that quantile transformation of the data did not yield an improvement in performance results, so our final results do not include quantile transformation.
Results
Here, we present the performance of our central/satellite galaxy classification and halo mass prediction algorithms, based on the neighbouring distance and stellar mass information.
From Figure 1, we can see that the neighbouring galaxy distribution differs around central galaxies compared to satellites. Making use of the 10 closest neighbouring distances, the galaxies’ stellar masses, and XGBoost, we were able to classify galaxies in the TNG100 and EAGLE simulations to an accuracy of . The results are shown in subsection 3.1.
Since halos and their central galaxies evolve together, there should be a correlation between the halo mass and the neighbouring galaxy distances of its central galaxy; halo mass would affect satellite density, infall, and thus inner galaxy distribution. Using the centrals we classified in subsection 3.1, we also infer the mass of their host halos, again from the TNG100 and EAGLE simulations. The results are presented in subsections 3.2.1 and 3.2.2.
Central vs. Satellite Galaxy Classification
In this subsection, we show the results of central/satellite classification that are trained on the TNG simulation only, then tested on both an independent subset of TNG data, and on a separate simulation, EAGLE. This is to see the robustness of our model across different simulations with different subgrid physics, such as star formation and AGN feedback models. We also have a fiducial mass cut of , and a mixture of galaxies from different sub-selected mass cuts (). The differing mass cut for the mixed sample was also an input parameter used in the training process.
From the receiving operating characteristic (ROC) curves in Figure 3, it can be seen that using the distances, mass-cuts, and stellar masses of the galaxies, the classification algorithm works quite well - all ROC curves have an area under curve (AUC) of and the overall probabilities are predicted with a success rate of (see Figure 5 and Figure 6), for testing on TNG and EAGLE. Training and testing on the same dataset (TNG) does yield a slightly better result than training and testing on a different dataset, due to the galaxy formation mechanisms for the testing and training sets being identical, but even across the different simulations, the AUCs are still very close to 1, which indicates a very good classification. These results are further bolstered by Figure 4 and Table 1, which both show purity and completeness values of at the threshold where the two are equal, across all training and testing sets. Quantile transformation of the data also did not yield an improvement in the results (see 4 in the Appendix).

Figure 3. Galaxy classification results. “Fiducial” uses neighbours with ; “Different ” combines neighbour selections at , , and
Figure 4. Purity-completeness curves. Orange lines show metrics that correspond to a model trained and evaluated on TNG data, with a fiducial fixed cut having a dark shade and varying cuts having a lighter shade. Blue lines show metrics that correspond to a model trained on TNG data and tested on EAGLE, again with a dark shade representing a fiducial fixed cut and a lighter shade representing varying cuts
| Distance | Test sample | Selection | value | Threshold | AUC | Avg. Precision |
| 3D | TNG | One -cut | 0.9673 | 0.3017 | 0.9981 | 0.9958 |
| 3D | TNG | Different -cut | 0.9983 | 0.5385 | 0.9999 | 0.9999 |
| 3D | EAGLE | One -cut | 0.9451 | 0.4547 | 0.9957 | 0.9884 |
| 3D | EAGLE | Different -cut | 0.9489 | 0.4688 | 0.9937 | 0.9895 |
| (2+1)D | TNG | One -cut | 0.9611 | 0.01073 | 0.9804 | 0.9910 |
| (2+1)D | TNG | Different -cut | 0.9974 | 0.3358 | 0.9998 | 0.9999 |
| (2+1)D | EAGLE | One -cut | 0.9481 | 0.5363 | 0.9956 | 0.9881 |
| (2+1)D | EAGLE | Different -cut | 0.9485 | 0.5755 | 0.9936 | 0.9897 |
Table 1. Central/Satellite Classification Metrics: Common purity and completeness, , at the crossover threshold. Again, here, “Fiducial” uses neighbours with ; “Different ” combines neighbour selections at , , and . Thresholds refer to the uncalibrated XGBoost score.
Figure 5. Accuracy of the central and satellite classification.

Figure 6. Bar plot of the probability of obtaining true/false positives and negatives of the central and satellite classification.
Figure 5 show the overall accuracy rate in predicting centrals and satellites; a more detailed version - in both 3D and (2+1)D - of this is in Figure 6. We can see the percentage of galaxies identified correctly as centrals and satellites, as well as false negatives/positives in each category. This is comparable to some results in Bowden & Behroozi [9], although we have much more satellite galaxies than centrals in our sample in comparison.
Host Halo Mass Predictions
With the galaxy central/satellite classifier working well with high purity scores and very high AUCs for their ROC curves, we take our classified centrals and try to predict their host halo mass. We start by assuming that we know the true centrals in the simulation, in order to assess the accuracy of neighbourhood-based mass estimation. We then extend the test to the centrals guessed by XGBoost, to allow for additional confusion introduced by satellite contamination of the sample. We discuss the results in subsections 3.2.1 and 3.2.2 below.
Predicting host halo masses from TNG
The mass of the host halo depends on its formation history, including mergers, which also affects the distribution of satellite galaxies. Therefore, there should be a correlation between the host halo mass and the distances of the closest neighbours to its central galaxy. Because stellar mass is also tightly correlated with the halo mass (Girelli et al. [19]), we include both the stellar mass of the central galaxy and that of its neighbours as additional training parameters.
To mimic the testing conditions on potential observations as closely as possible, we train on known centrals, then test on both known and predicted centrals since in observations, we will only have predicted centrals. We start with training and testing on TNG only to see how well the results generally perform. From Figure 7, it can be seen that both the true and predicted centrals are able to predict their host halo masses reasonably well, with .
Figure 7. TNG-trained and TNG-tested halo-mass regression for true centrals using 3D separations. The left panel uses the fiducial neighbour sample; the right combines the three neighbour thresholds. The lower panels show the plotted fractional residual statistic. RMSE is the root mean squared error and SP is the Spearman correlation coefficient.
Predicting host halo masses in EAGLE from TNG trained models
The overall goal of this analysis is to be able to predict host halo masses for real galaxies in observational data. The galaxies from observational catalogues will likely have different star formation mechanisms and thus different stellar mass distributions than in simulations. As a result, to mimic these unknown underlying differences, we tested on another simulation, EAGLE, without training on it at all; EAGLE has different galaxy and star formation mechanisms than TNG, so it is a proxy for what we would encounter in nature. Similarly to what we did for TNG above, we train on known centrals and test on both known and predicted centrals from EAGLE.
The results show that even when trained and tested on different simulations, the predictions remain fairly robust after we correct the stellar masses by a multiplicative factor (see § 2.1 and Figure 2). This is shown in Table 3. The values are 0.86 for the fiducial mass cut and 0.91 for combined varying mass cuts when switching the testing to an entirely new simulation, EAGLE - see Figure 8. Although this is not as good as training and testing solely on TNG, it can be seen here that testing and training on completely different simulations can still yield fairly robust results.
Figure 8. TNG-trained halo-mass regressors evaluated on true EAGLE centrals after stellar-mass CDF alignment, using 3D separations. The left panel uses the fiducial neighbour threshold and the right combines the three thresholds. Lower panels show the plotted fractional residual statistic.
| Distance | Centrals | Neighbour selection | CDF aligned? | RMSE [dex] | ||
| 3D | Known | One -cut | No | 0.81 | 0.19 | 0.92 |
| 3D | Known | One -cut | Yes | 0.86 | 0.16 | 0.92 |
| 3D | Known | Different -cuts | No | 0.85 | 0.19 | 0.94 |
| 3D | Known | Different -cuts | Yes | 0.91 | 0.15 | 0.93 |
| 3D | Guessed | One -cut | No | 0.69 | 0.26 | 0.90 |
| 3D | Guessed | One -cut | Yes | 0.73 | 0.22 | 0.90 |
| 3D | Guessed | Different -cuts | No | 0.76 | 0.26 | 0.93 |
| 3D | Guessed | Different -cuts | Yes | 0.83 | 0.22 | 0.92 |
| (2+1)D | Known | One -cuts | No | 0.81 | 0.19 | 0.92 |
| (2+1)D | Known | One -cuts | Yes | 0.84 | 0.18 | 0.92 |
| (2+1)D | Known | Different -cuts | No | 0.84 | 0.19 | 0.94 |
| (2+1)D | Known | Different -cuts | Yes | 0.87 | 0.17 | 0.93 |
| (2+1)D | Guessed | One -cuts | No | 0.69 | 0.26 | 0.90 |
| (2+1)D | Guessed | One -cuts | Yes | 0.73 | 0.24 | 0.90 |
| (2+1)D | Guessed | Different -cuts | No | 0.74 | 0.26 | 0.92 |
| (2+1)D | Guessed | Different -cuts | Yes | 0.77 | 0.25 | 0.92 |
| - | Known | Power law fit to | Yes | 0.78 | 0.21 | 0.86 |
| - | Known | XGBoost | Yes | 0.80 | 0.20 | 0.86 |
| - | Guessed | Power law fit to | Yes | 0.68 | 0.27 | 0.83 |
| - | Guessed | XGBoost | Yes | 0.69 | 0.26 | 0.84 |
Table 3. Cross-Dataset Host Halo Mass Inference: Summary comparison of main results for host halo mass predictions on EAGLE data. Like Table 2, there are different metrics for the host halo mass regression task with different XGBoost models, each trained and evaluated with different input features from TNG. The model is evaluated on EAGLE galaxies that are either “known” true centrals, or predicted centrals from a model trained on TNG data with neighbours selected with different cuts. Features include distances to 10 nearest neighbours and the stellar mass of the central (either known true central or predicted central) and stellar masses of the neighbours. The last four rows show the baseline prediction using a stellar-to-halo mass prediction, by both fitting a power law and using XGBoost on stellar mass only. The top two rows of the last four are the stellar-to-halo mass for known centrals, while the last two rows are for guessed centrals. The “known” rows for the scaling only should be compared to 10th and 12th rows of this table, while the “guessed” rows for the scaling only should be compared to 14th and 16th rows.
| Distance | Centrals | Neighbour selection | RMSE [dex] | ||
| 3D | Known | One -cut | 0.91 | 0.13 | 0.90 |
| 3D | Known | Different -cuts | 0.98 | 0.07 | 0.98 |
| 3D | Guessed | One -cut | 0.86 | 0.19 | 0.87 |
| 3D | Guessed | Different -cuts | 0.93 | 0.13 | 0.93 |
| (2+1)D | Known | One -cuts | 0.90 | 0.13 | 0.90 |
| (2+1)D | Known | Different -cuts | 0.93 | 0.13 | 0.93 |
| (2+1)D | Guessed | One -cuts | 0.85 | 0.21 | 0.92 |
| (2+1)D | Guessed | Different -cuts | 0.93 | 0.12 | 0.93 |
Table 2. Same Dataset Host Halo Mass Inference: Summary comparison of main results for host halo mass predictions on TNG100 for both training and testing. There are different metrics for the host halo mass regression task with different XGBoost models. The model is trained on a subset of TNG100, then tested on a different subset. The evaluated galaxies are either “known” true centrals, or predicted centrals from a model trained on TNG data with neighbours selected with different cuts. Features include distances to 10 nearest neighbours and the stellar mass of the central (either known true central or predicted central during the classification task) and stellar masses of the neighbours.
In addition, we tested our halo mass predictions on guessed centrals instead of true centrals; the results of this are seen in Figure 9. It can be seen here that the largest deviations in predicted host halo mass come from incorrectly classified galaxies, specifically satellites misclassified as centrals. From the misclassified galaxies in Figure 10 and Figure 13, we can further see that satellites with higher stellar masses or close to other centrals are more likely to be misclassified.
Figure 9. Fiducial mass cut of of the predicted centrals, used to predict their host halos in full 3D space, with the incorrectly identified centrals (actually satellites) coloured according to their stellar mass ratio and 3D distance to its closest central. Note that the closest central is not necessarily the central of the satellite’s host.
Figure 10. Incorrectly guessed centrals and their host masses in 3D space. It can be seen that misclassified galaxies closer to another halo’s central than their own host halo produces the largest discrepancy between predicted and actual host mass.
Figure 13. Incorrectly guessed centrals and their host masses in (2+1)D space. Consistent with the 3D case, it can be seen that misclassified galaxies closer to another halo’s central than their own host halo produces the largest discrepancy between predicted and actual host mass.
Redshift Space Results
The distances to other galaxies in real observations are most commonly measured in redshift space - we include the analysis for (2+1)D projected distances as well. The distances are now projected along the xy-plane and the redshift separation is calculated by using the coordinates and velocities of the galaxies in the z-direction, as well as the Hubble constant. The right panel of Figure 3 shows the ROC curves of a classification algorithm using the projected distance in 2D and the redshift along the z-direction. Similarly to the 3D analysis, we add in a domain alignment to account for different stellar formation models. We find that the (2+1)D results do not differ much from the 3D ones, as the AUC and the purity-completeness values are very similar (see Figure 4b). From this, we conclude that most classification errors likely do not come from projection effects, as going from 3D to (2+1)D does not change the prediction accuracy significantly.
We further include the host halo mass estimation for the (2+1)D projected distances, with the results shown in Figure 11. From Figure 3 and Figure 11, it can be seen that classification and host halo mass prediction work similarly well in the projection space as in the 3D space. Similarly to the 3D case, domain-aligning the stellar mass improves results in the (2+1)D classification - see Table 3. In Figure 12, it can be seen that the worst predictions come from misclassified centrals, again consistent with the 3D distance results.
Figure 11. TNG-trained halo-mass regressors evaluated on true EAGLE centrals in the D representation after stellar-mass CDF alignment. The left panel uses the fiducial neighbour threshold; the right combines the three thresholds.
Figure 12. Fiducial mass cut of of the predicted centrals, used to predict their host halos in D, with the incorrectly identified centrals (actually satellites) coloured according to their stellar mass ratio and distance (in D) to its closest central. Again, the closest central is not necessarily the central of the satellite’s host. The most severe underpredictions are low stellar mass satellites misclassified as centrals.
Summary of results on host halo mass predictions
It can be seen here that having the same stellar mass distribution improves results - testing and training TNG yields higher values than testing on EAGLE. Even with EAGLE, results improve with a stellar mass multiplier factor of 0.91 from the KS test for their stellar mass distributions. Quantile transforming still does not yield an improvement in results. Generally, the host halo mass can be predicted well, even in the worst case, with the simplest case of data wrangling (only adding a multiplicative factor to account for differences in stellar mass distributions).

Figure 3a. Receiving operating characteristic (ROC) curve (left) for the classification of central galaxies. We show results for an XGBoost model trained with TNG100 data to identify centrals based on neighbour galaxy distances selected on a fixed cut, and also an XGBoost model trained to identify centrals based on neighbour galaxy distances selected from varied cuts. Varying the neighbour selection in model training improves classification when evaluated on hold-out test data from the TNG100, but not when applied to the EAGLE dataset.
Figure 3b. Same as the plot on the left, except now using the 2D projection space. We include the results of training on TNG and testing on EAGLE, since that is a comparatively better proxy for real space observations, if we train on simulation data.
Figure 4a. Purity (dashed lines) and completeness (solid) curve of our XGBoost model predictions of centrals using the full 3D neighbouring distances.
Figure 4b. The purity-completeness curves using the 2D projection space distance.
training and testing are done on two different simulations and the testing sample consists of predicted centrals ( being the best prediction). This shows that there is a strong correlation between the closest satellite-central distances + stellar mass and galaxy type, as well as the central galaxy’s host halo mass. Quantile transforming the data does not yield an improvement in results (see Table 4). Instead, it was the inclusion of both neighbouring distances and stellar masses that yielded an improvement in results, showing that there is a necessity to go beyond the standard stellar-to-halo mass relation that has been used to predict halo mass in the past [31, 38]. Furthermore, multiplying the stellar mass by a domain alignment factor
Discussion
The galaxy classification is generally quite accurate, given the high AUC values across all training/testing samples, even when switching from one simulation, TNG, to another, EAGLE. The central galaxy’s neighbouring distances + stellar masses can also reliably predict most of their host halo masses, as from Table 3, it can be seen that the values are quite high, even when the training and testing are done on two different simulations and the testing sample consists of predicted centrals ( being the best prediction). This shows that there is a strong correlation between the closest satellite-central distances + stellar mass and galaxy type, as well as the central galaxy’s host halo mass. Quantile transforming the data does not yield an improvement in results (see Table 4). Instead, it was the inclusion of both neighbouring distances and stellar masses that yielded an improvement in results, showing that there is a necessity to go beyond the standard stellar-to-halo mass relation that has been used to predict halo mass in the past [31, 38]. Furthermore, multiplying the stellar mass by a domain alignment factor additionally improves results (see relative improvement for entries where “ CDF aligned?” is “yes” in Table 3 vs. entries where this is “no”). This domain alignment accounts for TNG and EAGLE having different star formation prescriptions that lead to different stellar mass functions and stellar-to-halo mass relations. We should also note that the AUC values from the 3D distance classification did not change significantly when switching to (2+1)D projected distances (see Figure 3a and 3b). From this, it seems that projection effects do not change the galaxy classification results in any significant way.
Figure 5a. Classification done using 3D distances.
Figure 5b. Classification done using (2+1)D projected distances.

Figure 6a. Probability accuracy of (2+1)D projected distances.

Figure 6b. Probability accuracy of full 3D distances.
Our analysis using both neighbouring stellar masses and distances results in a better prediction than the standard stellar-to-halo mass relation, which is often used to
estimate halo masses (Girelli et al. [19]). The last four rows of Table 3 show the prediction metrics (in bold) of the host halo mass from using both a power law scaling relation with the as well as by inputting into XGBoost. Both our 3D and (2+1)D predictions fared better than the stellar-to-halo mass estimations, as did both the guessed and known centrals. Note that we also CDF align the stellar mass function for the cross-dataset inference using a stellar-to-halo mass relation.
We also see that when combining both galaxy classification and host halo mass prediction - predicting the host mass of the predicted centrals (see Figure 9 and Figure 12) - the largest errors are underpredictions, driven by a combination of lower stellar masses of the misclassified “central” (actual satellite) and the misclassified “central” being closer to a lower mass halo than the central of its own host. The few misclassified galaxies that are closer to their own centrals than another halo’s central - but are still significantly underpredicting their host halo mass - have substantially less stellar mass than the true central of their host halo, which is what likely drives this host mass underprediction. In summary, the largest errors come from incorrectly classified galaxies either in their host halos’ outskirts - which happen to be closer to halo environments with smaller masses than those of their own host halos - and/or have low stellar masses in comparison to their true host centrals, see Figure 10 and Figure 13.
Comparison to previous works
There are several approaches in the literature to address the problem of central/satellite galaxy classification and host halo estimation based on environmental measures. Oguri & Lin [27] is one of the earlier works to utilize a counts-in-cylinder approach to characterize dark matter halo masses of galaxies, assuming an HOD framework for central/satellite classification to define a probability distribution function for their host halo mass inference task. We have included an additional component of explicitly inferring central/satellite classification as a step in our inference pipeline, which can directly yield a halo catalogue with estimated halo masses for observed galaxies that have measurements of right ascension (RA), declination (DEC), and either spectroscopic or photometric redshifts. Furthermore, instead of counting neighbours, we use the spatial distribution of galaxies around the central to classify the host halo mass.
In Bowden et al. [10], they compare how counts-in-cylinder information and distances to the k-nearest neighbours (explicitly utilized in our analysis) inform dark matter halo mass estimation, finding these to provide similar prediction power with neural networks. Our method of host halo mass estimation with an XGBoost model that utilizes neighbour information from known centrals has a similar RMSE to that found in Bowden et al. [10]. They further do a similar central/satellite classification task in a follow-up work (Bowden & Behroozi [9]), where they find comparable results to ours when looking at correctly classified centrals in the same stellar mass range. However, their results were obtained from training and testing on the same Universe Machine (Behroozi et al. [5]) output data. In our analysis, we trained on data from magnetohydrodynamical simulations (Nelson et al. [26]; Vogelsberger et al. [36]) from TNG100, then tested on another similar simulation that the training had no information on.
Finally, in Calderon & Berlind (2019), there exists a complementary study to constrain dark matter halo masses from galaxy properties using XGBoost and other machine learning algorithms, finding that these better constrained masses in out-of-distribution test datasets than traditional abundance matching and dynamical methods. With a simplified feature set (only neighbour distances and stellar masses), we have identified a potential mitigation strategy for evaluating an XGBoost halo mass estimator on an out-of-distribution dataset by adding a correction factor to align the CDFs of the stellar masses in the dataset. Our errors in halo mass estimation are comparable to those found in the work presented in Calderon & Berlind (2019); there is an average of around 20% scatter in the deviation from the host halo mass.
Limitations and Future Prospects
In this work, we used 10 distances as an arbitrary limit, although we found that generally 5-7 distances was enough for our results to be consistent. It would be interesting to test the optimal number of distances needed to correctly predict the host halo mass and if they differ for different host halo masses - between - - and different simulations. We also only used central galaxies to predict host halo masses here; no work was done about predicting subhalo masses from satellite distribution. Because satellite galaxies can have a much wider stellar mass/colour/spatial distribution compared to central galaxies due to their generally more complex environmental history, it is possible that subhalo masses would require more parameters than just spatial distribution and stellar mass to predict, and likely more than 10 neighbouring distances as well. The optimal number of neighbours, as well as the subhalo mass predictions, are beyond the current scope of this work.
In this work, we do not explicitly distinguish between the one-halo and two-halo regimes when considering galaxy environments, i.e., do not specify whether the 10 closest neighbours are part of the same halo as the central galaxy. Instead, we allowed XGBoost to learn the relevant relationships directly from the available neighbouring stellar masses and spatial information, mimicking the lack of information about halo membership in real observations. An important test of this method’s applicability to observations will be to determine how its performance changes when using projected galaxy separations, line-of-sight information, and stellar masses inferred from luminosity, as opposed to explicitly given simulated information. The real test of our proposal would then be to apply our methodology and analyses to observational galaxy catalogues. We should then account for differences between the stellar mass distributions of simulations and observations by using a stellar mass correction factor analogous to what we used for TNG100 vs. EAGLE above. One potential intermediate follow-up step can be to first test the method on simulated lightcones, prior to examining real space observational catalogues such as SDSS [32], DES [1], LSST [11], and Euclid [23].
From Figure 15 and Figure 16, it can be seen the worst underpredictions of host halo mass are associated with misclassified satellites physically closer to a lower mass halo’s central than its own host’s central. We suspect these galaxies could be from an actively merging system, either on its first infall or splashback. The local environment of these misclassified galaxies reflects the lower mass system, but has been identified by the algorithm as being associated with the more massive system. While these misclassified galaxies are problematic in our analysis, they could be potentially exploited to find ongoing mergers and splashback galaxies [18, 8]. By combining their positions on the galaxy outskirts with their spatial distribution, stellar mass, and velocity profiles in a future work, it could be possible to find a method to classify galaxies with (Gill et al. [18]) as splashback galaxies. The combination of a misclassified satellite both being closer to a neighbouring halo, and having a spatial distribution + stellar mass similar to that of a central is an interesting case to study, and could potentially be connected to infalling or splashback galaxies.
Figure 15. Fiducial mass cut of of the predicted centrals, used to predict their host halos, with the incorrectly identified centrals (actually satellites) coloured according to their stellar mass ratio and distance to its actual central, which is usually, but not always, the central closest to the satellite. Using full 3D distances.
Figure 16. Fiducial mass cut of of the predicted centrals, used to predict their host halos, with the incorrectly identified centrals (actually satellites) coloured according to their stellar mass ratio and distance to its actual central, which is usually, but not always, the central closest to the satellite. This is in redshift space distances.
Finally, simulations have a limited box size, which in this case was . As a result, we do not have halos larger than , and a limited number of cluster sized halos in general. However, in observations, halos have been observed, so whether this analysis can be extrapolated to them the same way will be an interesting test for the future - possibly trained and tested on COLIBRE (Schaye et al. 2026) as a proxy for observations. We also impose mass cuts on halos and stellar mass cuts on galaxies to take into account resolution limits - how our analysis will change for irregular dwarves with halos is still an open question for exploration.
Conclusion
In this work, we have shown that using the stellar mass 2 and spatial distribution (via neighbouring distances) of galaxies with the XGBoost algorithm is enough to classify the galaxy type as central or satellite and predict the host halo mass using the central properties. Quantile transforming the training properties do not yield an improvement in the results, but including a domain alignment of 0.91 did, so we used the original properties with a multiplication factor of 0.91. Switching from real space to redshift space projected distance also does not yield a significant difference in results, as the AUC and purity-completeness threshold values stay relatively constant.
When it comes to the FOF halo mass of the galaxies’ host, similar results apply - quantile transformation again does not improve the results, while adding a domain alignment to account for differences in stellar mass distributions yields significant improvement here. The largest errors from the mass prediction comes from misclassified central galaxies - if the galaxy type is known with 100% certainty, then the estimated vs. actual host mass
in observations, photometric or spectroscopic redshifts halo mass consistently has a , even above 0.9 if the same simulation is used in the testing and training sample. The largest discrepancies between predicted and actual halo mass occur when the misclassified galaxy in question is closer to another less massive halo’s central than its own central, and/or has a significantly lower stellar mass than its central. The misclassified galaxy is likely associated with environmental features from the smaller neighbouring halo. In future work, we can investigate potential mitigation methods, as well as the relationship between these misclassified galaxies to the merging history of its host halo.
Here, we have shown that using only spatial distribution and the stellar masses of galaxies is enough to predict both galaxy type and host halo mass. This methodology can further be extended to infer halo concentration, halo membership, and create localized mass maps. Future prospects include testing our analysis on observational data and optimizing for number of neighbours used, as well as extending this work to predict subhalo masses.
Acknowledgments
AC and NA are partially supported by the Natural Sciences and Engineering Research Council of Canada and Perimeter Institute for Theoretical Physics; research at the Perimeter Institute is supported in part by the Government of Canada through the Department of Innovation, Science and Economic Development Canada and by the Province of Ontario through the Ministry of Colleges and Universities. CA acknowledges support from the Leinweber Institute, DOE grant DE-SC0019193. This research was supported in part by the Simons Foundation through the Simons Foundation Emmy Noether Fellows Program at Perimeter Institute. YTL acknowledges support from the National Science and Technology Council grant NSTC 115-2112-M-001-018.
Appendix: Comparison of Different Classification Methods for Galaxies
The results for all our analysis above were obtained using XGBoost. However, before going to that, we tested some other classification methods as well (both analytical/statistical and other machine learning algorithms). The summarized results of those are outlined below.
Other Machine Learning Algorithms
We perform a brief test of model performance comparisons on the central vs. satellite classification task with Logistic Regression, a simple two-layer fully connected neural network, then XGBoost. The input features are still neighbouring distances and stellar masses. We use both the original simulation data and also features that have been quantile transformed in the analysis. Quantile transforming neighbour distances as input features improves the performance for Logistic Regression and the 2-layer neural network, while quantile transformed features do not improve performance with XGBoost. In either case, XGBoost had the best performance overall (see Table 4), which is why we ended up going with that for our final analysis.
When including the stellar mass of the neighbouring galaxies along with the distances, the value of increases. When including other galaxy properties as features, quantile transforming the features makes little difference in model performance. Note that the addition of the galaxy’s own internal properties beyond stellar mass have a negligible change on the model’s performance.
Predicted centrals error summary
We used the closest 10 neighbours for a more comprehensive study, but not all 10 nearest neighbours are actually needed for good halo mass estimation results in § 3.2.1 - this is shown in Figure 14 where we see the errors plateau around the fifth closest neighbour.
(a) Performance metrics found using (2+1)D projected distances.
(b) Performance metrics found using 3D distances.
Figure 14. Summary of the halo mass estimation performance metrics using each galaxy’s neighbouring distance, up to the 10 closest distances.
Finally, we show that the 3D full distances do a slightly better job of estimating the host halo mass of the galaxies from the and RMSE values in Figure 15 and Figure 16. We also see that the largest errors in predicted mass come from misclassified galaxies; both results are consistent with Figure 9 and Figure 12 in § 3 above. We further include the distance and stellar mass ratios between the misclassified galaxies and their actual centrals here to further emphasise that satellites with either large stellar masses or small distances to a central are more likely to be misclassified.
This paper was built using the Open Journal of Astrophysics LaTeX template. The OJA is a journal which provides fast and easy peer review for new papers in the astro-ph section of the arXiv, making the reviewing process simpler for authors and referees alike. Learn more at http://astro.theoj.org.
References
- [1]Abbott, T. M. C., et al. 2022, Phys. Rev. D, 105, 023520, doi: 10.1103/PhysRevD.105.023520DOI
- [2]Ade, P. A. R., et al. 2014, Astron. Astrophys., 571, A16, doi: 10.1051/0004-6361/201321591DOI
- [4]Asgari, M., Mead, A. J., & Heymans, C. 2023. https://arxiv.org/abs/2303.08752
- [5]Behroozi, P., Wechsler, R. H., Hearin, A. P., & Conroy, C. 2019, MNRAS, 488, 3143, doi: 10.1093/mnras/stz1182DOI
- [6]Berlind, A. A., Weinberg, D. H., Benson, A. J., et al. 2003, Astrophys. J., 593, 1, doi: 10.1086/376517DOI
- [7]Bilicki, M., et al. 2021, Astron. Astrophys., 653, A82, doi: 10.1051/0004-6361/202140352DOI
- [8]Borrow, J., Vogelsberger, M., O’Neil, S., McDonald, M. A., & Smith, A. 2023, Monthly Notices of the Royal Astronomical Society, 520, 649, doi: 10.1093/mnras/stad045DOI
- [9]Bowden, H., & Behroozi, P. 2025. https://arxiv.org/abs/2509.25312
- [10]Bowden, H., Behroozi, P., & Hearin, A. 2023, The Open Journal of Astrophysics, 6, 37, doi: 10.21105/astro.2307.07549DOI
- [11]Brough, S., Collins, C., Demarco, R., et al. 2020, arXiv e-prints, arXiv:2001.11067, doi: 10.48550/arXiv.2001.11067DOI
- [13]Chen, T., & Gill, C. 2016, arXiv e-prints, arXiv:1603.02754, doi: 10.48550/arXiv.1603.02754DOI
- [14]Cooray, A., & Sheth, R. K. 2002, Phys. Rept., 372, 1, doi: 10.1016/S0370-1573(02)00276-4DOI
- [15]Dabrowska, D. M. 2005, arXiv Mathematics e-prints, math/0511508, doi: 10.48550/arXiv.math/0511508DOI
- [16]Dalla Vecchia, C., & Trujillo, I. 2025, arXiv e-prints, arXiv:2510.19926, https://arxiv.org/abs/2510.19926
- [17]Donnari, M., Pillepich, A., Nelson, D., et al. 2021, Mon. Not. Roy. Astron. Soc., 506, 4760, doi: 10.1093/mnras/stab1950DOI
- [18]Gill, S. P. D., Knebe, A., & Gibson, B. K. 2005, Monthly Notices of the Royal Astronomical Society, 356, 1327, doi: 10.1111/j.1365-2966.2004.08562.xDOI
- [19]Girelli, G., Pozzetti, L., Bolzonella, M., et al. 2020, Astron. Astrophys., 634, A135, doi: 10.1051/0004-6361/201936329DOI
- [20]Kennedy, J., Gawiser, E., Iyer, K. G., & Yung, L. Y. A. 2026, Astrophys. J., 1003, 247, doi: 10.3847/1538-4357/ae58a3DOI
- [21]Lin, Y.-T., Mandelbaum, R., Huang, Y.-H., et al. 2016, ApJS, 819, 119, doi: 10.3847/0004-637X/819/2/119DOI
- [22]McAlpine, S., et al. 2016, Astronomy and Computing, 15, 72, doi: 10.1016/j.ascom.2016.02.004DOI
- [23]Mellier, Y., et al. 2025, Astron. Astrophys., 697, A1, doi: 10.1051/0004-6361/202450810DOI
- [26]Nelson, D., et al. 2019, Comput. Astrophys. Cosmol., 6, 2, doi: 10.1186/s40666-019-0028-x
- [27]Oguri, M., & Lin, Y.-T. 2015, Astrophys. J., 801, 94, doi: 10.1088/0004-637X/801/2/94DOI
- [28]Peacock, J. A., & Smith, R. E. 2000, Mon. Not. Roy. Astron. Soc., 318, 1144, doi: 10.1046/j.1365-8711.2000.03779.xDOI
- [29]Schaye, J., et al. 2015, Mon. Not. Roy. Astron. Soc., 446, 521, doi: 10.1093/mnras/stu2058DOI
- [31]Schechter, P. 1976, ApJ, 203, 297, doi: 10.1086/154079DOI
- [32]SDSS Collaboration, & Agakhanyan, M. e. a. 2026, ApJS, 285, 9, doi: 10.3847/1538-4365/ae4697DOI
- [33]Skibba, R. A., van den Bosch, F. C., Yang, X., et al. 2011, MNRAS, 410, 417, doi: 10.1111/j.1365-2966.2010.17452.xDOI
- [34]The IllustrisTNG Collaboration. 2019, IllustrisTNG100. https://www.tng-project.org/data/downloads/TNG100/
- [35]Tinker, J. L., Kravtsov, A. V., Klypin, A., et al. 2008, Astrophys. J., 688, 709, doi: 10.1086/591439DOI
- [36]Vogelsberger, M., Marinacci, F., Torrey, P., & Puchwein, E. 2020, Nature Rev. Phys., 2, 44, doi: 10.1038/s42254-019-0127-2DOI
- [37]Wechsler, R. H., & Tinker, J. L. 2018, Ann. Rev. Astron. Astrophys., 56, 435, doi: 10.1146/annurev-astro-081817-051756DOI
- [38]Weigel, A. K., Schawinski, K., & Bruderer, C. 2016, MNRAS, 459, 2150, doi: 10.1093/mnras/stw756DOI
- [39]White, S. D. M., & Frenk, C. S. 1991, ApJ, 379, 52, doi: 10.1086/170483DOI
- [40]Zehavi, I., et al. 2005, Astrophys. J., 630, 1, doi: 10.1086/431891DOI
- [41]Zheng, Z., Berlind, A. A., Weinberg, D. H., et al. 2005, ApJ, 633, 791, doi: 10.1086/466510


















