# Machine Failure Prediction Using Survival Analysis
## 5 Results
### Model Training and Results  
For our evaluation, we measured the predictions of the RSF model against a normal random forest model, which was trained with the exact same dataset and configuration as the RSF but with the downside of ignoring the right-censored data, unlike in RSF. We used the models one time to make the prediction using the whole dataset (Table 3) and its features and another time with the feature selecting layer (Table 4). In both, we used the metric of the C-index to calculate the accuracy of each model. It is important to note that both models were trained using identical hyperparameters for the calculation of the C-index. The data were divided into a 75% training and 25% testing set to evaluate the performance of our model. For the RSF, we selected the splitting criterion based on the log-rank test, which compares survival curves between two or more groups. The data were applied to the RSF model consisting of 1000 trees. To make a prediction, a sample descends tree by tree down to a terminal node in the forest. The data in each terminal node are used for non-parametric estimation of the survival function and cumulative hazard using the Kaplan-Meier and Nelson-Aalen estimators, respectively. Additionally, the risk score representing the expected number of events for a particular terminal node can also be computed. The overall prediction is the average of all the predictions of the trees in the forest. The model produced very accurate prediction results for machine failure, about 97%, as well as when the machine failed due to heat dissipation failure (HDF-99%), overload \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline \multirow{2}{*}{**Model**} & **Machine Failure** & \multirow{2}{*}{**HDF**} & \multirow{2}{*}{**OSF**} & \multirow{2}{*}{**PWF**} & \multirow{2}{*}{**RNF**} & \multirow{2}{*}{**TWF**} \\  & **Failure** & & & & & \\ \hline RSF & 0.9724 & 0.9977 & 0.9735 & 0.9951 & 0.7644 & 0.6841 \\ RF & 0.9627 & 0.9093 & 0.9958 & 0.9987 & 0.4792 & 0.9217 \\ COX PH & 0.8983 & 0.9672 & 0.9955 & 0.9965 & 0.8603 & 0.9718 \\ ST & 0.8476 & 0.6457 & 0.9420 & 0.9670 & 0.4967 & 0.6874 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Model results for machine failure and all its causes with feature selection, using C-index. Figure 8: Cumulative hazard and survival curves based on machine type. \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline \multirow{2}{*}{**Model**} & **Machine Failure** & \multirow{2}{*}{**HDF**} & \multirow{2}{*}{**OSF**} & \multirow{2}{*}{**PWF**} & \multirow{2}{*}{**RNF**} & \multirow{2}{*}{**TWF**} \\  & **Failure** & & & & & \\ \hline RSF & 0.9724 & 0.9976 & 0.9735 & 0.9936 & 0.6695 & 0.5446 \\ RF & 0.9558 & 0.9145 & 0.9956 & 0.9986 & 0.3899 & 0.9222 \\ COX PH & 0.8837 & 0.9944 & 0.9957 & 0.9965 & 0.3931 & 0.9642 \\ ST & 0.8447 & 0.9399 & 0.8868 & 0.9475 & 0.4972 & 0.6302 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Model results for machine failure and all its causes with the whole dataset, using C-index. (OSF\(\sim\)97%), and lack of power supply (PWF-99%). In cases of random failure (RNF) and tool wear failure (TWF), the model did not predict the outcome as efficiently, achieving a C-index of \(\sim\)54% for RNF and \(\sim\)0.67% for TWF. This fact is likely due to the lack of sufficient machines that have stopped working due to these causes, as well as the more difficult nature of predicting them. The results show that the RSF model has the upper hand in the main prediction of the machine failure out of all the models tested but lacks in the prediction of some types of failure. In the failure prediction and without using the data analysis/selection layer, the model that kept up with the RSF in terms of C-index score was random forest with a score of 0.9558, only 0.0166 less than the C-index of RSF. Both COX PH and ST scored below 90%. As for the types of failure, the results showed an imbalance among the predictions of the models, where no model excelled in the prediction of all the types.