# Recommendation Algorithm Based on Survival Action Rules
## 3 Methods
### Recommendation Induction
#### 3.3.2 Final Recommendation  
The final recommendation is generated by applying a customized version of the survival rule induction algorithm (Algorithm 1) to the meta-table. This ensures that the method can be applied to any previously unseen example due to the structure of the meta-table. The algorithm works on a single test example \(x\) associated with a survival curve \(\hat{S_{S}}\). There are two methods for constructing a KM curve to characterize test examples. The first \begin{table}
\begin{tabular}{c c c c c c c c c c} \hline \(ma\) & 1 & 1 & 2 & 2 & 3 & 3 & 4 & 4 & 5 & 5 \\ \(mb\) & 0 & 1 & 0 & 1 & 0 & 1 & 0 & 1 & 0 & 1 \\ \hline \end{tabular}
\end{table} 
Table 1: An exemplary meta-table. The table columns display examples from the metastable, along with the values these examples have for the attributes \(ma\) and \(mb\). method uses the meta-table, and the second method uses an arbiter model. The principle of the method is illustrated in the Figure 5.  
In the first case, the survival curve is constructed from training examples using a meta-table. Each meta-example is covered by several examples from the initial (training) set of examples \(D(A,T,\delta)\), while each example from this set is covered by only a single meta-example. To define \(\hat{S}_{S}\), a meta-example \(mx\) is identified that covers the example \(x\). Finally, the Kaplan-Meier estimator (\(\hat{S}_{S}\)) is defined based on all training examples from \(D\) that are covered by \(mx\). In some cases, the number of training examples covering \(mx\) may be small. This, in turn, affects the confidence in the estimated curve \(\hat{S}_{S}\). In such a case, the arbiter model method is used to associate \(x\) with \(\hat{S}_{S}\). The arbiter model is a survival data model trained on the entire set of training examples \(D\). In the article, an implementation of gradient boosting with a regression tree-based learner [25] is used as the arbiter model. The trained arbiter model generates the survival curve \(\hat{S}_{S}\) associated with the example \(x\). Regardless of the method used, the survival curve \(\hat{S}_{S}\) is treated as the conclusion of a hypothetical rule \(r_{S}\) (3) covering the test example \(x\). The recommendation process involves suggesting specific changes to the attribute values of example \(x\). The aim of these changes is to align the test example with a meta-example (or multiple meta-examples) that will move the test example from its current Kaplan-Meier curve, denoted as \(\hat{S}_{S}\), to a different target Kaplan-Meier curve, \(\hat{S}_{T}\). The algorithm aims to minimize the number of attribute changes required for this reassignment. The range of values into which a test example is carried is determined by more than one meta-example as long as the ranges of attribute values in these meta-examples are adjacent and together produce a curve of better quality than any of them individually. The process described above is equivalent to the induction of an \(r_{T}\) (4) rule as described in Algorithms 1 and 2. In the induction process, the algorithm searches for a rule \(r_{T}\) built on a set of meta-examples whose conclusion \(\hat{S}_{T}\) differs the most from the survival curve \(\hat{S}_{S}\). To determine the degree of difference, the two curves are compared using the Kolmogorov-Smirnov test with two samples [60]. **Example 3**. : _Let us assume that the induction of recommendations is conducted in the meta-table presented in the previous example and that a test example \(x=(10,0)\) is given. The example  
Figure 5: Diagram illustrating principle of the method. covers the meta-example \((3,0)\). The survival curve \(\hat{S}_{S}\) associated with \(x\) is determined based on all examples from the training set that covers the meta-example \((3,0)\). Let us further assume that the recommendation algorithm suggests only one action \(ma\leq 2\). This recommendation implies that there is no need to change the value of the attribute \(mb\) (\(b\)). The value \(ma=2\) represents the interval \((-2.5,4.5]\).