The kernel ridge regression (KRR) approach is extended to include the odd-even effects in nuclear mass predictions by remodulating the kernel function without introducing new weight parameters and inputs in the training network. By taking the WS4 mass model as an example, the mass for each nucleus in the nuclear chart is predicted with the extended KRR network, which is trained with the mass model residuals, i.e., deviations between experimental and calculated masses, of other nuclei with known masses. The resultant root-mean-square mass deviation from the available experimental data for the 2353 nuclei with $Zge8$ and $Nge8$ can be reduced to 128 keV, which provides the most precise mass model from machine learning approaches so far. Moreover, the extended KRR approach can avoid the risk of worsening the mass predictions for nuclei at large extrapolation distances, and meanwhile, it provides a smooth extrapolation behavior with respect to the odd and even extrapolation distances.