## 3 Data-Driven Adaptive Sampling Algorithm
Afterwards, based on the very threshold value, a NME will be obtained comparing the reconstructed signal against the training set. If each of the five subsets is denoted as A, B, C, D and E separately, the outcome for the cross-validation is presented in Table 4. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Training Sets** & **ABCD** & **ABCE** & **ABED** & **ACED** & **BCED** \\ \hline Testing set & E & D & C & B & A \\ Threshold & 0.0102 & 0.0113 & 0.0115 & 0.0120 & 0.0136 \\ NME & 3.37\% & 3.40\% & 3.12\% & 2.53\% & 2.25\% \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Model validation using five-fold cross-validation. Figure 8: Algorithm performance with respect to the remaining battery level. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline  & **DDASA** & **DDASA** & **ASA** & **DDASA** & **Fixed Rate Sampling** \\  & **(f = 0.115)** & **(f = 0.112)** & **ASA** & **(f = 0.110)** & **(f = 1/3600 Hz)** \\ \hline Number of Samples & 320 & 422 & 637 & 1591 & 2182 \\ NME & 5.33\% & 4.26\% & 5.31\% & 1.14\% & 0 \\ Remaining Battery Level & 86.03\% & 82.86\% & 80.72\% & 75.19\% & 55.37\% \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Performance comparison between ASA and data-driven adaptive sampling algorithm (DDASA) using DO data. It turns out that through the cross-validation process, the average value of NME is 2.93% while a suggested average value of threshold is 0.01172. This threshold value and its corresponding NME also correspond with the results presented in Table 1, where a slightly smaller value of \(t\) results in a smaller NME, while a slightly larger value of \(t\) leads to a higher NME. Also, to prove that this algorithm is universally applicable, a different dataset from Intel Berkeley Research lab [26] has been utilized. The dataset is comprised of real-time data for temperature, humidity, light and voltage measured by Mica2 Dot sensor nodes within a WSN (see Figure 9). In particular, a set of temperature data consisting of 25,000 samples, which were collected by Sensor 13 from 28 February 2004 to 20 March 2004, is selected as the original data set. Based on the whole data set, a suggested threshold for sampling is derived based on Equation (5), which is 0.0016. Afterwards, the reconstructed signal is given in Figure 10, with an NME equal to 0.08% and 17,957 samples needed. Since around 7000 samples are deducted comparing with the original data set, it should therefore be believed much energy can be saved throughout the sampling process. Furthermore, since the accuracy of the reconstructed signal is 99.2% when \(t\) equals to 0.0016, for the sake of saving more energy, slightly increasing the value of \(t\) and thus reducing the sample numbers should also be acceptable. For instance, when \(t\) increases to 0.0020, the corresponding NME is 0.29%, while only 11,423 samples are necessarily collected. Figure 10: (a) Original Temperature data from Intel Berkeley Research Lab; (b) Sampled Temperature data with 0.0016. Figure 9: Wireless sensor network (WSN) setup in the Intel Berkeley Research Lab. ## 7 Conclusions

In this paper, a data-driven adaptive sampling algorithm (DDASA) for node-level sampling was presented. It was proven that this algorithm was robust for different types of parameter sampling, and could effectively conserve energy with a satisfactory reconstructed signal. Compared with some existing adaptive sampling algorithms, which are battery-state driven, there are justifiable occasions where the sampling frequency is based on the real-time sampled data, especially when the fluctuation of the environmental parameters, is of significant interest. Additionally, it was shown that, by dynamically changing the sampling frequency according to the newly sampled data, the proposed DDASA would outperform a traditional ASA with respect to the accuracy of the reconstructed signal and the energy conservation. Thus, the goal of prolonging the life time of the nodes has been achieved with the proposed approach.