# Recommendation Algorithm Based on Survival Action Rules
## 3 Methods
### Survival Action Rule Induction
This is determined by maximizing the log-rank statistic's value by comparing the example subset covered by the action rule against those not covered. If multiple conditions equally maximize the log-rank value, the condition expanding the uncovered example set the most is selected. ```
0:\(D\)--a dataset \(D_{u}\)--a collection of examples that are not yet covered \(\mu\)--the minimum number of examples that the new rule must cover \(\rho\)--the maximum rule coverage \(\xi\)--the maximum percentage of examples that can be covered by both the left and right rules \(A_{s}\)--a set of stable attributes from the set A
0:\(r\)--the action rule
1:functionSpecialize(\(D,D_{u},\mu,\rho,\tau,A_{s}\))
2:\(\varphi,\varphi_{S},\varphi_{T}\leftarrow\emptyset\)\(\triangleright\) the premise of the created action rule, a set of source elementary conditions, and a set of target elementary conditions
3:\(W_{ignore}\leftarrow\emptyset\)\(\triangleright\) a set of elementary conditions already checked
4:repeat
5:\(w_{\text{\it best}_{\xi}}\leftarrow\textsc{BestElementaryCondition}(D,D_{u}, \varphi_{S},\mu,\rho,W_{ignore})\)
6:\(W_{ignore}\gets W_{ignore}\cup\{w_{\text{\it best}_{\xi}}\}\)
7:if\(w_{\text{\it best}_{\xi}}=\emptyset\)then\(Contine\)
8:\(a\leftarrow\textsc{Attribute}(w_{\text{\it best}_{\xi}})\)
9:\(w_{\text{\it best}_{\tau}}\leftarrow\textsc{Counter-condition}(D,\varphi_{S} \wedge w_{\text{\it best}_{\xi}},\varphi_{R},w_{\text{\it best}_{\xi}},\mu,\tau, \xi,A_{s})\)
10:\(action\leftarrow\textsc{BuildAction}(w_{\text{\it best}_{\xi}},w_{\text{\it best }_{\tau}})\)
11:\(\varphi\leftarrow\varphi\wedge action\)
12:\(\varphi_{S}\leftarrow\varphi_{S}\wedge w_{\text{\it best}_{\xi}}\)
13:\(\varphi_{T}\leftarrow\varphi_{T}\wedge w_{\text{\it best}_{\tau}}\)
14:until\((w_{\text{\it best}_{\xi}}=\emptyset)\)
15:\(\hat{S}_{S}\leftarrow\textsc{KM}\) for set\(\textsc{CoveredExamples}(\varphi_{S},D)\)
16:\(S_{T}\leftarrow\textsc{KM}\) for set\(\textsc{CoveredExamples}(\varphi_{T},D)\)
17:return\(r\equiv\textsc{IF}\)\(\varphi\)THEN \(\hat{S}_{S}\to\hat{S}_{T}\)
18:endfunction
```  
**Algorithm 2** Specialization of the action rule in the survival analysis. Line 6 indicates that the best-identified elementary condition is added to the \(W_{ignore}\) set, which contains conditions already evaluated. This addition ensures that the condition is not repeatedly selected in the loop if a counter-condition is not identified, thus preventing its redundant inclusion in the rule's premise. The search for the best counter-condition (line 9) follows the principle that, upon finding the best condition \(w_{i_{\xi}}\) for attribute \(a_{i}\), a counter-condition is sought. This counter-condition, \(w_{i_{\tau}}\) for the same attribute, aims to maximize the log-rank test value between subsets defined by the initial source premise with \(w_{i_{\xi}}\) and the target premise with \(w_{i_{\tau}}\). Once rule specialization is complete, the rule's generalization phase begins. During this phase, actions are systematically removed from the premise to assess whether the log-rank measure's value for the revised rule improves or remains unchanged. Pruning finishes when no further actions can be removed or when any modification would diminish the rule's quality. This phase may also end if the rule covers all examples from the set. Action removal is governed by two principles. An action is retained if its removal would increase the proportion of examples covered by a single rule beyond the \(\rho\) parameter value, preventing overly general rules. The second principle involves the maximum shared example proportion between the source and target rules, which, if exceeding the \(\xi\) parameter, prevents the action's removal, ensuring significant differentiation between the rule's source and target example groups. For missing values, a strategy of ignoring such values is employed. This approach focuses on creating rules based only on available, observed values, excluding observations with missing attribute values from rule coverage.