## 5 Case Study
### Detailed Description of the SIRPM Model
  
* Phase 3: Machine Learning Model Training  
With the historical dataset ready, the machine learning (ML) model was trained. Decision trees (CART) were chosen for their simplicity and interpretability, especially given the limited data volume. Training Process:  
* Data cleaning: removal of inconsistencies and handling of missing values. * Normalization: scaling data to ensure comparability and training accuracy. * Data splitting: 80% of the data was used for training, with 20% reserved for model validation. The CART algorithm (classification and regression trees) was configured to identify failure patterns from the collected data. Decision trees are a widely used machine learning model that seeks to predict a value or class by constructing a hierarchical structure of decisions, represented by nodes. Each internal node of the tree corresponds to a condition on an attribute of the data, and the leaves contain the final prediction (value or class). The decision tree algorithm performs a series of divisions on the data based on criteria such as the Gini index or the mean squared error, aiming to optimize the homogeneity of the data in each subset generated. In the context of the SIRPM model, the regression tree (CART for regression) was chosen due to the objective of predicting continuous values, such as the time to failure in machines or the severity of component wear, rather than simply classifying a failure condition. The choice for regression was justified by the nature of the data collected (such as vibration, pressure, and temperature of machines), which are continuous numerical values, and the desired prediction was of a quantitative value, representing the probability or time to failure. The regression tree model was trained using historical machine data, after data cleaning and normalization, to accurately predict the occurrence of imminent failures, providing a continuous value that could be used to make preventive maintenance decisions. This approach was applied to the machine learning model with the CART algorithm training, using 80% of the data for training and 20% for validation in order to assess the accuracy of the model before its integration with the RPA system for automatic alert and maintenance actions. * Phase 4: Predictive Model Implementation with RPA Integration  
From the seventh month, the predictive machine learning model was integrated with the automated RPA system. The RPA bot (UIPath) was programmed to collect sensor data hourly, processing the last 24 h of information. The process involved the following:  
1. The RPA bot collected data and stored it in a SQL database. 2. A Python script executed the machine learning algorithm, reading SQL table values, making predictions, and saving results in a new table. 3. A secondary RPA script analyzed predicted values. If anomalies were detected, it generated automated email alerts to the maintenance team, specifying the affected machine and identified value. \begin{table} \begin{tabular}{c c c c} \hline \hline
**Month** & \begin{tabular}{c} **Average Vibration** \\ **(Cutter) (mm/s)** \\ \end{tabular} & \
\begin{tabular}{c} **Average** \\ **Pressure (Press) (bar)** \\ \end{tabular} &
\begin{tabular}{c} **Average** \\ **Temperature (Printer) (\({}^{\circ}\)C)** \\ \end{tabular} \\ \hline
1 & 1.2 & 150 & 75 \\ \hline
2 & 1.3 & 145 & 78 \\ \hline
3 & 1.4 & 140 & 80 \\ \hline
4 & 1.5 & 138 & 82 \\ \hline
5 & 1.3 & 142 & 77 \\ \hline \hline \end{tabular}   
* Phase 3: Machine Learning Model Training  
With the historical dataset ready, the machine learning (ML) model was trained. Decision trees (CART) were chosen for their simplicity and interpretability, especially given the limited data volume. Training Process:  
* Data cleaning: removal of inconsistencies and handling of missing values. * Normalization: scaling data to ensure comparability and training accuracy. * Data splitting: 80% of the data was used for training, with 20% reserved for model validation.