# Bearing Health Monitoring Using Relief-F-Based Feature Relevance Analysis and HMM
## 2 Stochastic Feature Selection
### Supervised Relevance Analysis under Stochastic Modeling  
In a practical application, the calculated multi-domain feature set \(\{\mathbf{X}_{n}\}_{n=1}^{N}\) has a vast number of parameters. This fact introduces noise and complexity for detecting/diagnosing tasks. Therefore, it is necessary to identify the most discriminating features to find a balance between system complexity and accuracy [44]. To achieve this aim, we compute the contribution of each \(T\), \(F\) and \(TF\) parameters in terms of the supervised information in the labels vector \(\mathbf{y}=\{y_{n}\}_{n=1}^{N}\). Our approach intends to codify the stochastic behavior in each feature matrix \(\mathbf{X}_{n}\) for the \(n\)-th vibration signal using a localized dissimilarity under supervised constraints and an HMM-based classifier. Initially, let \(\mathbf{\Gamma}\in\mathbb{R}^{N\times Q}\) be a feature matrix holding row feature vectors \(\mathbf{\gamma}=\text{vec}\left(\mathbf{X}_{n}\right),\) where \(\text{vec}\left(\cdot\right)\) stands for the vectorization function. We calculate the relevance vector \(\mathbf{\
u}\in\mathbb{R}^{Q}\) using the relief-F-based gain [56]:  
\[\text{Gain}_{q}=\frac{1}{N}\sum_{n=1}^{N}\left(-\frac{1}{\varphi}\sum_{\mathbf{ \gamma}_{\mathbf{\
u}^{\prime}}\in\Omega_{n}^{m}}d(\gamma_{n}^{q},\gamma_{\mathbf{\
u} ^{\prime}}^{q})+\frac{1}{\varphi}\sum_{c\
eq y_{n}}\frac{p(\mathbf{y}=c)}{1-p(\bm {y}=y_{n})}\sum_{\mathbf{\gamma}_{\mathbf{\
u}^{\prime}}\in\Omega_{n}^{m}}d(\gamma_{n} ^{q},\gamma_{\mathbf{\
u}^{\prime}}^{q})\right), \tag{2}\]  
where \(d:\mathbb{R}\times\mathbb{R}\rightarrow\mathbb{R}\) is a given distance function, \(\Omega_{n}^{c}=\{\mathbf{\gamma}_{\mathbf{\
u}^{\prime}}:n^{\prime}=1,2,\ldots,\varphi\}\) holds the \(\varphi\)-nearest neighbors of \(\mathbf{\gamma}_{n}\) according to \(d_{\gamma}\gamma_{\mathbf{\
u}}^{q}\in\mathbb{R}\) is the value of the \(q\)-th feature for instance \(n\), and \(p(\mathbf{y}=c)\in\mathbb{R}^{+}\) is the probability that a sample belongs to the \(c\)-th class (\(c\in\{1,2,\ldots,C\}\)); \(q\in\{1,2,\ldots,Q\}\). In this sense, the localized measure in Equation (2) allows quantifying the discrimination capability of the T, F, and TF parameters. In fact, the higher the \(\
u_{q}\) value, the better the \(q\)-th feature for discriminating fault categories in bearing diagnosis [57]. Now, to estimate the relevance of the \(M\) multi-domain features under the windowing scheme, we sort the vector \(\mathbf{\
u}\) into a feature relevance matrix \(\mathbf{\Delta}\in\mathbb{R}^{W\times M}\) concerning the \(W\) segment partitions, as follows:  
\[\mathbf{\Delta}= \begin{bmatrix}\
u_{1}&\
u_{2}&\cdots&\
u_{M}\\ \
u_{M+1}&\
u_{M+2}&\cdots&\
u_{2M}\\ \vdots&\vdots&\ddots&\vdots\\ \
u_{W(M-1)+1}&\
u_{W(M-1)+2}&\cdots&\
u_{WM}\end{bmatrix} . \tag{3}\]  
In turn, the \(M\) multi-domain features can be ranked according to the value of the relevance vector \(\mathbf{\rho}\in\mathbb{R}^{M}\), holding elements:  
\[\rho_{m}=\frac{1}{W}\sum_{\mathbf{\
u}=1}^{W}|\Delta_{\mathbf{\
u}\mathbf{\
u}}|, \tag{4}\]  
where \(\Delta_{\mathbf{\
u}\mathbf{\
u}}\in\mathbf{\Delta}\) and \(m\in\{1,2,\ldots,M\}\). As a result, our feature ranking allows explaining the measured locality preservation capability provided by each feature along with the \(W\) segments of the input vibration signals, since the obtained relevance vector \(\mathbf{\rho}\) preserves the one-to-one relationship to the multi-domain parameters. Further, a Hidden Markov Model (HMM) was employed to represent the stochastic behavior of the \(W\) segments in \(\mathbf{X}_{n}\). Indeed, the use of hidden states makes the classification model generic enough to handle a variety of bearing fault diagnosis/severity classes [31; 58; 59]. Then, given an observation sequence matrix \(\mathbf{\hat{X}}\in\mathbb{R}^{W\times M^{\prime}}\) which was built after the selection of the \(M^{\prime}\)\(<M\) most relevant features