  Accurate estimation of photometric redshifts (photo-$z$) is crucial in
studies of both galaxy evolution and cosmology using current and future large
sky surveys. In this study, we employ Random Forest (RF), a machine learning
algorithm, to estimate photo-$z$ and investigate the systematic uncertainties
affecting the results. Using galaxy flux and color as input features, we
construct a mapping between input features and redshift by using a training set
of simulated data, generated from the Hubble Space Telescope Advanced Camera
for Surveys (HST-ACS) and COSMOS catalogue, with the expected instrumental
effects of the planned China Space Station Telescope (CSST). To improve the
accuracy and confidence of predictions, we incorporate inverse variance
weighting and perturb the catalog using input feature errors. Our results show
that weighted RF can achieve a photo-$z$ accuracy of $\rm \sigma_{NMAD}=0.025$
and an outlier fraction of $\rm \eta=2.045\%$, significantly better than the
values of $\rm \sigma_{NMAD}=0.043$ and $\rm \eta=6.45\%$ obtained by the
widely used Easy and Accurate Zphot from Yale (EAZY) software which uses
template-fitting method. Furthermore, we have calculated the importance of each
input feature for different redshift ranges and found that the most important
input features reflect the approximate position of the break features in galaxy
spectra, demonstrating the algorithm's ability to extract physical information
from data. Additionally, we have established confidence indices and error bars
for each prediction value based on the shape of the redshift probability
distribution function, suggesting that screening sources with high confidence
can further reduce the outlier fraction.
