## 5 Information Processing Module (IPM) Design
### Logistic Regression (LR)  
Unlike linear regression (LinR), which predicts values from a continuous and infinite range, classification models predict outcomes from a limited set of discrete classes, which makes them a more appropriate solution for the problem under analysis. In the current problem, the number of classes is clearly two, as the target variable can take just two possible values: \"No Fault\" and \"Fault\" (Figure 3). In this context, the positive class (class 1) represents the \"Fault\" condition, while the negative class (class 0) corresponds to the \"No Fault\" condition. Figure 12: Final dataset after feature normalization. Logistic regression (LR) is a ML classification model that estimates the probability of a class occurring for a given combination of feature values. To do so, it applies the logistic (sigmoid) function to a linear combination of the input features, where the importance of each feature is determined by its corresponding coefficient. In LinR, the target, \(t_{lin}\), presents a linear relationship with a set of features, \(f\ =\ (f_{1},\ldots,f_{N})\), as can be seen in Equation (5):  
\[\hat{t}_{lin}(f_{1},\ldots,f_{N})=k_{0}+k_{1}\cdot f_{1}+\ldots+k_{N}\cdot f_{N} \tag{5}\]  
where \(\hat{t}_{lin}\) represents the predicted target and \((k_{0},\ldots,k_{N})\) represent the model coefficients. Therefore, by combining (5) with the sigmoid function (\(\sigma\)(t)), it is possible to derive the fundamental model for the LR. \[LR(f)=\sigma(t_{lin}(f_{1},\ldots,f_{N}))=\frac{1}{1+e^{-(t_{lin}(f_{1},\ldots,f_{N}))}}=\frac{1}{1+e^{-(k_{0}+k_{1}\cdot f_{1}+\ldots+k_{N}\cdot f_{N})}} \tag{6}\]  
Equation (6) defines a parametric model that is characterized by the coefficients \((k_{0},\ldots,k_{N})\) and which estimates the probability that a sample of dataset \(DS\), defined by a specific combination of feature values, is associated with class 1:  
\[ \begin{split} given:DS=\begin{cases}\quad features:f=(f_{1}, \ldots,f_{N})\\ target:t=(\text{'class 0','class 1'})\end{cases}\Rightarrow\hat{t}_{log} \approx t;\hat{t}_{log}=\begin{cases}\text{'class 0', }if\ LR(f)<0.5\\ \text{'class 1', }if\ LR(f)\geq 0.5\end{cases}\\ as:LR(f)=0.5\Leftrightarrow t_{lin}(f_{1},f_{2},\ldots,f_{N})=0\Rightarrow \hat{t}_{log}=\begin{cases}\text{'class 0', }if\ t_{lin}(f_{1},f_{2},\ldots,f_{N})<0\\ \text{'class 1', }if\ t_{lin}(f_{1},f_{2},\ldots,f_{N})\geq 0\end{cases}\end{split}  \tag{7}\]  
where \(LR(f)\) represents the probability of class 1 occurring, \(\hat{t}_{log}\) represents the class prediction, \(t_{lin}(f_{1},\ f_{2},\ldots,f_{N})\) the decision boundary (DB), and \(t\) the real class. Decision boundaries (DBs) can be either linear (LDBs) or non-linear (NLDBs). While NLDBs can model complex relationships that linear boundaries cannot capture, they also substantially increase the model complexity, computational cost, and risk of overfitting. For this reason, the proposed LR model, \(PLR(f)\), is based on a linear decision boundary (LDB), as shown in Equation (8). \[PLR(f)=\frac{1}{1+e^{-(k_{0}\cdot t_{\text{outMC}}+k_{1}\cdot t_{\text{outMC}} +k_{2}\cdot t_{\text{outMC}}+k_{3}\cdot P_{\text{outMC}}+k_{4}\cdot P_{\text{ mLDC}}+k_{5}\cdot R+k_{6}\cdot i_{\text{inMC}}+k_{7})}} \tag{8}\]  
Thus, once the model has been identified, it is necessary to determine the coefficients \((k_{0},\ldots,k_{7})\) that best fit the classification problem. This procedure is performed during the training stage, the main objective of which is to find the model coefficients that maximize the likelihood of \(\hat{t}_{log}=t\) for each sample in the training dataset. Hence, it is essential to identify a cost function that enables the evaluation of how effectively the \((k_{0},\ldots,k_{7})\) parameters allow the \(PLR(f)\) model to better fit the training dataset. Given the nature of the logistic function, the cost function commonly used in LinR, \(CF_{linR}\), is not suitable for LR, as it would generate a non-convex function that would have multiple local minima.