# Real-Time Sea State Estimation for Wave Energy Converter Control via Machine Learning
## 4 Control Design
### Feature Extraction
Then, the composite \(z\)-score for feature \(i\) is given by  
\[z_{\text{composite},i}=\sum_{j=1}^{m}w_{j}\cdot z_{i,j} \tag{23}\]  
where \(w_{j}\) is the weight assigned to the \(j\)-th evaluation method, with \(\sum_{j=1}^{m}w_{j}=1\). Each \(z_{i,j}\) is normalized to ensure comparability across different methods and scales, typically by converting raw scores into \(z\)-scores based on the mean and standard deviation of the metric values for all features. This study uses three feature evaluation metrics to construct the composite \(z\)-score: Pearson correlation coefficient [21], variance threshold [22], and SHAP scores [23]. Each metric captures a unique aspect of feature relevance, with Pearson correlation measuring linear relationships, variance thresholding highlighting high-variance features, and SHAP scores providing model-agnostic importance based on feature contributions to predictions. The scores from each metric are normalized to ensure comparability and then combined into a composite \(z\)-score using a weighted sum:  
\[z_{\text{composite},i}=w_{1}\cdot z_{i,\text{correlation}}+w_{2}\cdot z_{i, \text{variance}}+w_{3}\cdot z_{i,\text{SHAP}} \tag{24}\]  
where \(w_{1}\), \(w_{2}\), and \(w_{3}\) are weights assigned to each metric, with \(w_{1}+w_{2}+w_{3}=1\). The weights are selected based on cross-validation performance to ensure optimal feature selection for our specific model and data. After calculating \(z_{\text{composite}}\) for each feature, the top 10 features with the highest \(z_{\text{composite}}\) values are selected as the final feature set. This composite \(z\)-score approach demonstrates improved robustness and interpretability compared to single-metric feature selection as shown in our empirical results in Section 4. \begin{table}
\begin{tabular}{p{113.8 pt} p{113.8 pt} p{113.8 pt}} \hline
**Feature** & **Significance** & **Mathematical Representation** \\ \hline Peak Frequency & The frequency corresponding to the maximum PSD. & \(f_{\text{peak}}=\arg\max P(f)\) \\ Spectral Centroid & Center of mass of the power spectrum. & \(f_{\text{centroid}}=\frac{\sum fP(f)}{\sum P(f)}\) \\ Spectral Flatness & Ratio of geometric mean to arithmetic mean of the power spectrum. & \(F_{\text{flat}}=\frac{\exp\left(\frac{1}{N}\sum P(f)\right)}{\frac{1}{N}\sum P (f)}\) \\ Spectral Entropy & Quantifies the uniformity of spectral energy distribution. & \(H=-\sum P(f)\log P(f)\) \\ Band Power & Power in low (0–1 Hz), mid (1–3 Hz), and high frequencies. & \(\int_{f_{\text{low}}}^{f_{\text{high}}}P(f)df\) \\ Wavelet Entropy & Measures disorder in wavelet energy distribution. & \(H_{\text{wavelet}}=-\sum P(s)\log P(s)\) \\ Dominant Wavelet Scale & Scale corresponding to highest wavelet energy. & \(\frac{\sum(W(s,t)-w_{W})^{3}}{\sigma_{W}^{3}}\) \\ Wavelet Skewness & Asymmetry of wavelet coefficients’ distribution. & \(\frac{\sum(W(s,t)-w_{W})^{4}}{\sigma_{W}^{4}}\) \\ Wavelet Kurtosis & Peakedness of wavelet coefficients’ distribution. & \(\frac{\sum(W(s,t)-w_{W})^{4}}{\sigma_{W}^{4}}\) \\ Teager Energy Operator & Captures localized energy variations in the signal. & \(\sum_{n=2}^{N-1}x_{n}^{2}-x_{n-1}x_{n+1}\) \\ \hline \end{tabular}
\end{table} 
Table 2: Selected top 10 features.