In wireless sensor networks, data prediction is an efficient technique to reduce the number of redundant data transmissions for applications that require sensor nodes to regularly report their readings. This paper proposes a series of novel self-adapting linear prediction algorithms for the sensor nodes to report their readings to the sink or to the cluster head when clustering technology is used. We propose a dynamical extraction algorithm to select a suitable training set from the history time series data; we propose an information criterion-based searching algorithm to find a better training set if the chosen training set is not valid for the training of the new predictors; and we propose an exception detection scheme to determine whether the linear predictors are efficient for data prediction. Experimental results based on the practical temperature time series data demonstrate the efficiency of the proposed algorithms, and our prediction algorithms show a significant improvement of the performance in reducing the number of data transmissions and the transmission energy cost.