  Gamma-ray bursts (GRBs) can be probes of the early universe, but currently,
only 26% of GRBs observed by the Neil Gehrels Swift Observatory GRBs have known
redshifts ($z$) due to observational limitations. To address this, we estimated
the GRB redshift (distance) via a supervised statistical learning model that
uses optical afterglow observed by Swift and ground-based telescopes. The
inferred redshifts are strongly correlated (a Pearson coefficient of 0.93) with
the observed redshifts, thus proving the reliability of this method. The
inferred and observed redshifts allow us to estimate the number of GRBs
occurring at a given redshift (GRB rate) to be 8.47-9 $yr^{-1} Gpc^{-1}$ for
$1.9<z<2.3$. Since GRBs come from the collapse of massive stars, we compared
this rate with the star formation rate highlighting a discrepancy of a factor
of 3 at $z<1$.
