# Recommendation Algorithm Based on Survival Action Rules
## 3 Methods
### Basic Notions  
Consider a set \(D(A,T,\delta)\) of \(|D|\) examples. Each example is described with a set of attributes \(A=\{a_{1},a_{2},\ldots,a_{|A|}\}\), an observation time \(T\), and a survival status \(\delta\).  
A straightforward and understandable form of knowledge representation rules. In general, rules take the form of an implication: IF \(\varphi\) THEN \(\psi\), where \(\varphi\) is the premise of the rule and \(\psi\) is the conclusion. In rule-based reasoning, the premise \(\varphi\) determines the conditions that must be satisfied for the conclusion \(\psi\) to be true. The rule premise takes the form of a conjunction of elementary conditions \(w_{i}\equiv a_{i}\odot\varphi_{i}\), where \(v_{i}\) is an element of the domain of the attribute \(a_{i}\), and \(\odot\) is a relation (= for symbolic attributes or \(<,\leq,>,\geq,\in\) for ordinal and numerical attributes). An example is considered to be covered by a rule if it satisfies the conditions specified in the rule's premise. The conclusion \(\psi\) of a rule varies based on its type, including classification, association, regression, survival, or action rules.  
In the case of survival rules, the conclusion is the estimator of a survival function (e.g., the Kaplan-Meier estimator). A survival rule, therefore, has the following form:  
\[\text{IF }w_{1}\wedge w_{2}\cdots\wedge w_{n}\text{ THEN }\hat{S}. \tag{1}\]  
The survival function resulting from the conclusion of an action rule describes the survival time of all examples covered by the rule. A survival action rule is a combination of two action rules:  
\[\text{IF }w_{1S}\to w_{1T}\wedge w_{2S}\to w_{2T}\cdots\wedge w_{nS}\to w_{nT} \tag{2}\] \[\text{THEN }\hat{S}_{S}\to\hat{S}_{T}.\]  
An action rule's premise is composed of a conjunction of elementary actions. Each elementary action, denoted as \(w_{iS}\to w_{iT}\), signifies a modification in the attribute \(a_{i}\)'s value. This includes the elementary action's premise, \(w_{S}\), outlining the initial value range of the attribute, and the elementary action's conclusion, \(w_{T}\), detailing the desired target value range.  
The survival action rule can be decomposed into two survival rules (called source (3) and target (4) rules):  
IF  
\[w_{15}\wedge w_{25}\cdots\wedge w_{n5}\]  
THEN  
\[\hat{S}_{S}\]  
, (3) IF  
\[w_{1T}\wedge w_{2T}\cdots\wedge w_{nT}\]  
THEN  
\[\hat{S}_{T}\]  
. (4)  
Applying the actions contained in the premise of the survival action rule (2) results in a change in the estimated survival time for the examples covered by the source and target rules.  
For an elementary action \(w_{iS}\to w_{iT}\), three cases can be distinguished: \(w_{iS}\
eq w_{iT}\), \(w_{iS}=w_{iT}\), and the last case where the range of the target part is not specified (i.e., \(w_{iS}\to\text{ANY}\)). The first case represents a real change in the value of the attribute \(a_{i}\), while the second represents the preservation of the attribute value. It can be said that, in the second case, the attribute value should not be changed, and in the third case, the attribute can take any value.  
**Example 1**.: _To illustrate the concept of survival action rules, let us consider the body mass index (BMI), which measures the proportionality of body weight in relation to height and age. It is well known that people classified as overweight or obese have a higher risk of premature death than those with a normal BMI._  
_A normal BMI is between 18.5 and 24.9. A BMI between 25.0 and 29.9 is considered overweight, while a BMI of 30.0 or higher is considered obese._  
_Now, let us define two groups of people characterized by BMI values as follows: \(\text{BMI}>30\) and \(\text{BMI}\in[19,25]\)._  
_These groups are characterized by two different survival curves, as shown in Figure 1. The survival action rule (5) states that a reduction in BMI to the range [19; 25] will increase the estimated survival time, as shown by the curve \(S_{2}\)._  
\[\text{IF BMI}>30\to\text{BMI}\in[19,25]\]  
THEN  
\[S_{1}\to S_{2}\]  
. (5)