We present a new analysis of the rest-frame UV and optical spectra of a sample of three $z>8$ galaxies discovered behind the gravitational lensing cluster RX\,J2129.4+0009. We combine these observations with $z>7.5$ galaxies from the literature, for which similar measurements are available. As already pointed out in other studies, the high [\oiii]$\lambda$5007/[\oii]$\lambda$3727 ratios ($O_{32}$) and steep UV continuum slopes ($\beta$) are consistent with the values observed for low redshift Lyman continuum emitters, suggesting that such galaxies contribute to the ionizing budget of the intergalactic medium. We construct a logistic regression model to estimate the probability of a galaxy being a Lyman continuum emitter based on the measured \MUV, $\beta$, and $O_{32}$. Using this probability and the UV luminosity function, we construct an empirical model that estimates the contribution of high redshift galaxies to reionization. The preferred scenario in our analysis shows that at $z\sim8$, the average escape fraction of the galaxy population (i.e., including both LyC emitters and non-emitters) varies with \MUV, with intermediate UV luminosity ($-19Comment: 10 pages, 7 figures, accepted by MNRAS