# Predicting Output Power for Nearshore Wave Energy Harvesting
## 3 Methods
### Data Segmentation and Feature Selection  
Features serve to describe the characteristics of the source in machine learning. Feature extraction is used to obtain new features that are extracted from the original data. These new features are fewer in  
Figure 4: Data collection module (**left**: transmitter; **right**: receiver). Figure 3: Schematic diagram of the data collection procedure. number, but are still effective in describing the source. Therefore, it is necessary to find quality features from the transmitted data to characterize the wave. The data received from the buoys contain the information of the wave for energy harvesting. It is usually corrupted by noise or outliers, so it must go through preprocessing procedures to filter out abnormalities. Noise occurs in all measurements; outliers may include recording errors caused by faulty operation in the sensor, for example. In this study, we employed a moving average filter. The raw time series data from the MPU 6050 contain angular velocities (\(\omega_{x}\), \(\omega_{y}\), \(\omega_{z}\)) and accelerations (\(\alpha_{x}\), \(\alpha_{y}\), \(\alpha_{z}\)). Since these values represent movement information of the buoy at a specific moment, they are not viable as a feature set for machine learning algorithms. We segmented the dataset into a certain size to use as a feature. Windowing approaches are normally used for segmentation, but no clear consensus exists on which window size should be preferably employed [15]. One reliable clue is the period of the wave. It is obvious that the segmented data correspond to at least more than one period to carry the characteristics of the wave. The longer data seem to be the better representation, but it in turn becomes a burden for computation and should be restrained. In this work, we chose the size of data to be at least one period or longer. Feature selection has a significant impact on the performance of the prediction model and the computation time of the system. Therefore, features should capture important information of the data [16]. The angular velocities and accelerations are orientation-sensitive data, but the associated power generation may be independent of orientation. It is necessary to generate new orientation-insensitive variables from the angular velocities and accelerations, such as the magnitudes of accelerations (\(\alpha\)) and angular velocities (\(\omega\)). This magnitude equals the Euclidean distance from the origin. From the eight variables including the original six measurements and two magnitudes from segmented dataset, we derived sixteen new statistical variables that can characterize the windowed interval. The new features consist of the means of the accelerations (\(\mu_{\alpha_{x}}\), \(\mu_{\alpha_{y}}\), \(\mu_{\alpha_{x}}\), \(\mu_{\alpha}\)), the means of the angular velocities (\(\mu_{\omega_{x}}\), \(\mu_{\omega_{y}}\), \(\mu_{\omega_{z}}\), \(\mu_{\omega}\)), the variances of the accelerations (\(\sigma^{2}_{\alpha_{x}}\), \(\sigma^{2}_{\alpha_{y}}\), \(\sigma^{2}_{\alpha_{x}}\), \(\sigma^{2}_{\alpha}\)) and the variances of the angular velocities (\(\sigma^{2}_{\omega_{x}}\), \(\sigma^{2}_{\omega_{y}}\), \(\sigma^{2}_{\omega_{x}}\), \(\sigma^{2}_{\omega}\)). Feature scaling is a process of standardizing the range of independent variables [17]. Since the features derived from the dataset can have various ranges of values, applying the features without standardization to a machine learning algorithm would yield erroneous outcomes. Among the varieties of feature scaling techniques, we used the standard scaling approach in this paper. Standard scaling, often called Z-score normalization, transforms our feature into a standard normally-distributed variable (Gaussian with a mean of zero and a unit standard deviation).