The kernel ridge regression (KRR) method with a Gaussian kernel is used to improve the description of the nuclear charge radius by several phenomenological formulae. The widely used , and formulae, and their improved versions including isospin dependence, are adopted as examples. The parameters in these six formulae are refitted using the Levenberg–Marquardt method, which give better results than the previous versions. The radius for each nucleus is predicted with the KRR network, which is trained with the deviations between experimental and calculated nuclear charge radii. For each formula, the resultant root-mean-square deviations of 884 nuclei with proton number and neutron number can be reduced to about 0.017 fm after considering the modification by the KRR method. The extrapolation ability of the KRR method for the neutron-rich region is examined carefully and compared with the radial basis function method. It is found that the improved nuclear charge radius formulae using the KRR method can avoid the risk of overfitting, and have a good extrapolation ability. The influence of the ridge penalty term on the extrapolation ability of the KRR method is also discussed. Finally, the nuclear charge radii of several recently observed K and Ca isotopes are analyzed.