  The determination of distance is fundamental in astrophysics. Gamma-ray
sources are poorly characterized in this sense, as the limited angular
resolution and poor photon-count statistics in gamma-ray astronomy makes it
difficult to associate them to a multiwavelength object with known redshift.
Taking the 1794 active galactic nuclei (AGNs) with known redshift from the
Fermi-LAT latest AGN catalog, 4LAC-DR3, we employ machine learning techniques
to predict the distance of the rest of AGNs based on their spectral and spatial
properties. The state-of-the-art CatBoost algorithm reaches an average 0.56 R2
score with 0.46 root-mean-squared error (RMSE), predicting an average redshift
value of $z_{avg}=0.63$, with a maximum $z_{max}=1.97$. We use the SHAP
explainer package to gain insights into the variables influence on the outcome,
and also study the extragalactic bakground light (EBL) implications. In a
second part, we use this regression model to predict the redshift of the
unassociated sample of the latest LAT point-source catalog, 4FGL-DR3, using the
results of a previous paper to determine the possible AGNs within them.
