  In this paper, we calibrate the luminosity relation of gamma-ray bursts
(GRBs) with the machine learning (ML) methods for reconstructing
distance-redshift relation from the Pantheon+ sample of type Ia supernovae (SNe
Ia) in a cosmology-independent way. The A219 GRB data set at low redshift are
used to calibrate the Amati relation ($E_{\rm p}$-$E_{\rm iso}$) relation by
the ML methods selected with the best performance %and the calibrated results
are extrapolated to the high redshift data to construct the Hubble diagram at
high redshift. We constrain cosmological models via the Markov Chain Monte
Carlo numerical method with the GRBs at high redshift and the latest
observational Hubble data (OHD). By the K-Nearest Neighbors (KNN) methods, we
obtain $\Omega_{\rm m}$ = $0.29^{+0.09}_{-0.06}$, $h$ = $0.66^{+0.04}_{-0.07}$
, $w_0$ = $-0.83^{+0.66}_{-0.31}$, $w_a$ = $-0.91^{+0.87}_{-0.46}$ at
1-$\sigma$ confidence level for the Chevallier-Polarski-Linder (CPL) model in a
flat space, which favor the dark energy with a possible evolution ($w_a\neq0$)
at 1-$\sigma$. These results are consistent with those obtained from GRBs
calibrated via the Gaussian Process.
