## 3 Real-Building Case Study
### Create Validation Dataset  
A random-forest-based pattern recognition technique is applied to the case study to create the same number of validation data (or \"fake\" missing data) from good data, by mimicking the real missing data characteristics. Pattern recognition here means we want to recognize the pattern of real missing data to find some good data with similar characteristics with real missing data, so that we can use those good data as validation dataset to test various data imputation methods.  
\begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Sensor Name** & **Hour** & **Day** & **Weekday Indicator** & **Month** & **Average** \\ \hline peco\_meter/elec\_usage\_chiller & 2.30 & 1.17 & 2.06 & 2.18 & **1.93** \\ chws\_control/chw\_flow & 2.26 & 0.79 & 2.01 & 2.15 & **1.80** \\ chws\_control/chws\_temp & 2.09 & 0.22 & 1.86 & 1.96 & 1.53 \\ chws\_control/delta\_press & 2.24 & 0.71 & 1.99 & 2.12 & 1.77 \\ chws\_control/cw\_delta\_press & 1.53 & 0.57 & 1.26 & 1.35 & 1.18 \\ chws\_control/cwr\_temp & 2.11 & 0.27 & 1.80 & 1.97 & 1.54 \\ chws\_control/cw\_vlv\_fdbk & 2.15 & 0.68 & 1.88 & 2.02 & 1.69 \\ ct\_control/ct\_fan\_status/trend\_log & 2.06 & 0.18 & 1.78 & 1.92 & 1.49 \\ ahu1/ra\_temp/trend\_log & 2.15 & 0.25 & 1.82 & 2.02 & 1.56 \\ ahu1/econ & 1.63 & 0.60 & 1.35 & 1.46 & 1.26 \\ ahu1/chw\_valve & 1.77 & 0.82 & 1.41 & 1.61 & 1.40 \\ ahu1/ra\_humidity & 2.11 & 0.68 & 1.83 & 1.99 & 1.65 \\ ahu1/sfan\_amps & 1.82 & 0.55 & 1.43 & 1.67 & 1.37 \\ ahu1/htg\_stm\_vlv\_1\_3 & 1.08 & 0.36 & 0.61 & 0.86 & **0.73** \\ ahu1/stat\_press & 1.08 & 0.01 & 0.59 & 0.82 & **0.62** \\ ahu1/pht\_temp & 1.53 & 0.56 & 1.17 & 1.35 & 1.15 \\ vv-1-b-1/air\_flow/flow\_input & 1.46 & 0.70 & 1.18 & 1.27 & 1.15 \\ vv-1-b-1/da\_temp/trend\_log & 2.39 & 0.39 & 2.14 & 2.27 & 1.79 \\ \hline Average & **1.85** & 0.49 & 1.54 & 1.70 & 1.39 \\ \hline \hline \end{tabular}
\end{table}
Table 3: Randomness of missing data (Z-score) for each sensor in terms of hour of day, month, and weekday indicator.  
Figure 3: Example of missing data for whole building energy meter.  
We apply a supervised random-forest-based pattern recognition technique to realize the generation of validation dataset, or \"fake\" some missing data but with truth value. For each sensor, we label the missing data with 1 and good data with 0, which is the output of a random forest regressor. The inputs for the regressor are weather and time indicators, including outdoor air temperature, outdoor humidity, outdoor air enthalpy, hour of the day, day of the week, weekday indicator (0 for weekday and 1 for weekend), and month of the year. All the information from inputs are from timestamp of sensors and the corresponding weather that is recorded at the timestamp. We train the regressor based on the inputs and output. The model can predict under what time and weather the sensor will possibly miss a value. With that trained model, test the training inputs again and check the value of the output. The larger the testing output (or closer to 1), the more likely the data has the characteristics of missing data in terms of time and weather. Besides the n real missing data from one sensor, selected the other n good data with the highest testing output, which will show similar characteristics with the real missing data. Figure 4 shows an example of how a validation data point is generated based on its similar characteristics with one of the missing data in the chiller energy meter. The random forest algorithm is realized by a Python machine-learning library called scikit-learn. The parameters of random forest algorithm are all set to default.