## 4 Implementation
### Diagnosis Algorithm Implementation  
In this study, the AdaBoost (Adaptive Boosting) algorithm was applied for fault classification using the provided dataset. AdaBoost is an ensemble learning technique  
Figure 4: FFT plots showcasing the dominant frequency components within the 0.1 to 0.2 and 0.2 to 0.3 Hz ranges for different fault levels in DC motor operation. that combines multiple weak classifiers to form a robust classifier [40]. Let \(X\) denote the feature matrix and \(y\) denote the target variable, assumed to be 'Fault Status' in this context. The dataset was partitioned into training and testing sets, with a test size of 20% and a random state of 40 to ensure reproducibility. The weak classifier chosen for AdaBoost was a Decision Tree Classifier with a maximum depth of 1, denoted as \(h(x;\theta_{i})\), where \(\theta_{i}\) represents the parameters of the weak classifier. The Decision Tree Classifier is defined in Equation (25). \[h(x;\theta_{i})= \begin{cases}1&\text{if }x_{j}<s\\ -1&\text{otherwise}\end{cases}  \tag{25}\]  
\(x_{j}\) represents the feature value, and \(s\) is the splitting threshold determined during training. For classification tasks, a Decision Tree Classifier serves as a supervised learning algorithm. It works by recursively partitioning the feature space into regions and assigning a class label to each region. The Decision Tree consists of root, internal, and leaf nodes. Each internal node represents a decision based on the value of a feature, and each leaf node represents a class label. Let \(\mathcal{X}\) denote the feature space, \(\mathcal{Y}\) denote the set of class labels, and \(D=\left\{(x_{1},y_{1}),(x_{2},y_{2}),\ldots,(x_{N},y_{N})\right\}\) denote the dataset, where \(x_{i}\) is a feature vector and \(y_{i}\) is the corresponding class label. A Decision Tree Classifier recursively splits the feature space into regions using decision rules. Each tree node applies a decision rule with a splitting threshold \(s\) to a feature \(x_{j}\). The process takes the left branch if the feature value \(x_{j}\) is less than the threshold \(s\); otherwise, it takes the right branch. The process continues until it meets a stopping criterion, which could be reaching a maximum depth or a minimum number of samples in a node. Mathematically, a Decision Tree Classifier at each internal node \(t\) applies a decision rule based on a feature \(x_{j}\) and a threshold \(s\). Let \(R_{t}\) denote the region of feature space associated with node \(t\). The decision rule can be represented as explained in Equation (26):  
\[R_{t}= \begin{cases}\{x\in\mathcal{X}:x_{j}<s\}&\text{if }x_{j}<s\\ \{x\in\mathcal{X}:x_{j}\geq s\}&\text{otherwise}\end{cases}  \tag{26}\]  
The decision rule is determined during the training phase by selecting the feature \(x_{j}\) and threshold \(s\) that optimally split the data according to a specific criterion, such as minimizing impurity or maximizing information gain. Once the Decision Tree is constructed, class labels are assigned to each leaf node based on the majority of the training samples in that region. This study used a Decision Tree Classifier with a maximum depth of 1, meaning that the Decision Tree consists of only a root node and two leaf nodes. This simple Decision Tree serves as a weak learner within the AdaBoost Ensemble. In our implementation, a Decision Tree Classifier with a maximum depth of 1 was denoted as DT\((d=1,R=40)\). An AdaBoost classifier with base estimator \(b=\text{DT}(d=1,R=40)\), number of estimators \(n=100\), and random state \(R=42\) was utilized. After initializing the Decision Tree Classifier as the weak learner, the AdaBoost algorithm is applied to sequentially fit the weak classifiers to the data and adjust the weights of misclassified samples to emphasize difficult-to-classify instances.