In order to improve the accuracy of electricity consumption forecasting in smart grid, a novel penalized weighted kernel partial least squares algorithm is presented. The original inputs are mapped into a high dimensional feature space to realize the linearization of nonlinear problems. The partial least squares algorithm is used to extract the principal component to reduce the dimensional of data. According to the local learning theory, a weighted least squares regression model is constructed based on the new data set formed by the principal component. The model sensitivity of abnormal data is reduced and the model parameters are optimized. The data from industrial electricity consumption of Jiangsu province in 2008 are used for validation and the results show that WK-PLS has higher accuracy than PLS in electricity load prediction.