O-glycosylation is one of the main types of the mammalian protein glycosylation, it occurs on the particular site of serine and threonine. It's important to predict the O-glycosylation site. In this paper, we propose a new method of kernel principal component analysis (KPCA) to predict the O-glycosylation site with window size w=9. The samples for experiment are encoded by the sparse coding and projected into kernel space first, then the features are extracted by PCA, at last the classification is done by Mahanalobis distance. The result of experiments shows that the proposed method of KPCA is more effective and accurate than PCA. The prediction accuracy is about 84.5%.