# Recommendation Algorithm Based on Survival Action Rules
## 4 Experiments and Results
### Case Studies
#### 4.1.1 Maintenance Dataset  
The maintenance dataset is available as part of the popular Python package, PySurvival [68]. Its attributes are well defined, so the values are easy to understand. Most of the conditional attributes in this dataset are of the flexible type, so they can be subjected to actions. The maintenance dataset contains five conditional attributes and two decision attributes:  
* pressureInd
* moistureInd
* temperatureInd
* provider
* team
* time
* status  
The pressure index (pressureInd) is used to quantify the flow of liquid through pipes, as a sudden drop in pressure may indicate a leak. The moisture index (moistureInd) is a measure of the relative humidity in the air. It is important to monitor this as excessive humidity can lead to mold and equipment damage. The temperature index (temperatureInd) of the machine is calculated using voltage devices called thermocouples, which convert a change in voltage into a measure of temperature. It is recorded to prevent damage to electrical circuits, fire, or even explosion. The team (team) and machine indicator (provider) specify which team was using the machine and the name of the machine manufacturer. These two attributes have been omitted to simplify the analysis. Survival time (time) indicates the number of weeks the machine has been active. Survival status (status) specifies whether the machine was broken or remained intact during the corresponding weeks of activity. This experiment was designed to see if the generated rules would show actions that would generate recommendations to change the working conditions of the machine to increase the length of the activity period. It was assumed that the values of all attributes could be changed (i.e., no stable attributes were defined in the dataset). The experiments were run in a 10-fold stratified cross-validation mode. For the case study, the first fold was selected. Table 6 provides a summary of the results from the experiment involving the induction of survival action rules. Chosen metrics representing the quality of the rule sets across different versions of the experiment are displayed. Rule induction was conducted in _ANY_ mode, where both types of rules--improving and worsening--can be formed. The experiment produced a relatively large number of rules--23. Each rule had at least one action, with the majority having three actions. The absence of differences between the average number of conditions (\(\overline{c}\)) and the average number of actions (\(\overline{a}\)) suggests that no supporting actions appeared in the rules. For every rule, the \(p\)-value resulting from the log-rank test comparing the Kaplan-Meier curves of the left and right sides was below 0.05. Only one rule had a \(p\)-value greater than 0.01. To present the sample results of the experiment, the selected rules obtained are presented in Table 7. They give information on what to focus on when maintaining the machine so that its active period does not decrease. The table shows only the premise part of the rules. For each rule presented in Table 7, the additional statistics were calculated (Table 8):  
* number of conditions,
* number of actions,
* the percentage of all examples that the left part of the rule covers,
* the percentage of all examples that the right part of the rule covers,
* \(p\)-value of the log-rank test between the Kaplan-Meier curves of the left and right sides of the rule,
* median survival time for examples covered by the left rule (time for probability = 0.5),
* median survival time for examples covered by the right rule,
* difference between the median survival times of the left side of the rule and the right side of the rule. An important measure is the \(p\)-value of the log-rank test between the Kaplan-Meier curves of the left and right sides of the rule. The lower the value of this measure, the further apart the two curves are.