# Machine Learning Algorithms for Prediction of Survival Curves in Breast Cancer Patients

Authors: Roqia Saleem Awad Maabreh; Malik Bader Alazzam; Ahmed S. AlGhamdi
Journal: Applied Bionics and Biomechanics
 (2021)

---

## Abstract

Today, cancer is the second leading cause of death worldwide, and the number of people diagnosed with the disease is expected to rise. Breast cancer is the most commonly diagnosed cancer in women, and it has one of the highest survival rates when treated properly. Because the effectiveness and, as a result, survival of the patient are dependent on each case, it is critical to know the modelling of their survival ahead of time. Artificial intelligence is a rapidly expanding field, and its clinical applications are following suit (having surpassed humans in many evidence-based medical tasks). From the inception of since first stable risk estimator based on statistical methods appeared in survival analysis, there have been numerous versions of it created, with machine learning being used in only a few of them. Nonlinear relationships between variables and the impact they have on the variable to be predicted are very easy to evaluate using statistical methods. However, because they are just mathematical equations, they have flaws that limit the quality of their output. The main goal of this study is to find the best machine learning algorithms for predicting the individualised survival of breast cancer patients, as well as the most appropriate treatment, and to propose new numerical variable stratifications. They will still be carried out using unsupervised machine learning methods that divide patients into groups based on their risk in each dataset. We will compare it to standard groupings to see if it has more significance. Knowing that the greatest challenge in dealing with clinical data is its quantity and quality, we have gone to great lengths to ensure their quality before replicating them. We used the Cox statistical method in conjunction with other statistical methods and tests to find the best possible dataset with which to train our model, despite its ease of multivariate analysis.


---

## Body

## 1. Introduction

Cancer is the second leading cause of death worldwide, with an estimated 9.6 million deaths in 2018 (1 in 6 deaths), and the cases of diagnosis and deaths from it continue to increase each year [1]. Survival analysis is very popular due to its simplicity, and, in addition to being used in medical statistics, it has extensive application in other fields such as economics, education, biology, or industry. The nonpayment of a credit when an electrical appliance stops working and the abandonment of studies by a student are some of the events that are studied with this technique. Its main application in medicine is to analyze events of interest: death, relapse, adverse reaction to a drug, or the development of a new disease. For all these cases, it is possible to model and know the risk of the event taking place in a range of time from weeks to years depending on the case. There are many predictors that have been developed to estimate the individual risk of women with breast cancer. Some of the best known and accepted in a standard way are the Gail model by Gail MH in 1989 [2]. The survival analysis aims to model the time that elapses until a certain event occurs, relating the outcome of a patient with its associated descriptive biological variables. In recurrence prediction studies, although, as in the previous case, statistical methods prevail [3, 4]. With some difficulty, we can find some studies that have applied computational learning [5], and the precision results of these increase significantly. In this project, we will analyze the behaviour of automatic learning models to predict death and recurrence against statistical methods, while we will take advantage of the advantages that the latter offer to select a set of variables. Optimal with which to train our model, a task in which they have given very good results over time.


## 2. Material and Methods

In the development of this project, we have worked in parallel with two sets of survival data Hospital and Attributes.(1)
Hospital dataset of patients with hormone receptor-positive breast cancer treated with adjuvant hormonal therapy, free of disease 5 years after the first diagnosis. They were taken from the Baghdad Teaching Hospital (Iraq). From these, we will analyze their probability of recurrence(2)
Patient samplesNumerical variables. Age 67 years on average, number of lymph nodes affected, number of lymph nodes removed, tumor size (in mm), and follow-up time (in years).Categorical variables. Menopausal status (premenopausal, postmenopausal), grade (I, II, and III), hormonal receptors (estrogen, progesterone, and her2), cancer subtype (Luminal A and Luminal B), risk (low, medium, and high), hormonal therapy (aromatase inhibitors (AI), Tamoxifen, and AI+Tamoxifen), last control state (dead with disease, dead without disease, alive with disease, and alive without disease), hormone receptor (created from hormone receptors: positive in estrogen and progesterone, positive in estrogen), and event (in this case, it means recurrence, with values 0 and 1).TCGA. We obtained this dataset, also from breast cancer patients, from The Cancer Genome Atlas [6], a public library with data on 33 types of cancer. For this, we have made use of the TCGA retriever library in R [7]. From these, we will analyze their probability of death.Software. All the software implemented in this project has been made in R, using RStudio. The packages used mainly have been mentioned throughout the methodology (survival, tcga, mlr, h2o, ...). The developed software is uploaded in the public repository https://github.com/nairachiclana/ML_and_Survival-BreastCancer in the form of .rmd files except for the code corresponding to the interface. The data from the TCGA set is extracted in the code; the data from the Hospital set cannot be shared due to data protection.Hardware. I have used my personal machine, macOS Mojave software version 10.14.5 with 8GB RAM, 1 TB of hard disk, and an Intel Core i5 3.4 GHz processor. Since the high-compute algorithms have been trained using the parallelization offered by h2o as mentioned above, the team has not assumed any limitations.


### 2.1. Methods

The objective is to find predictors of survival for each dataset and to be able to visualize the curves predicted from input variables in an interface. The first step is to prepare the data; for this, using statistical methods, we will evaluate which stratification is more adequate. It is the next step to cleaning data and essential for the proper functioning of machine learning algorithms. We will apply correlation analysis and confirm this by hypothesis tests in case it is necessary to eliminate any of this final set.


### 2.2. Variable Creation

The groupings that we will build and evaluate, in addition to those defined by the clustering algorithms, will be, in the variables that allow it, those defined by the paper that we replicate as the first task of this project [8] and those commonly used in medical practice. We can see them in Table 1.Table 1
Variable numerical aggregations.
VariableStandard groupingGrouping paperApplicable and clusterisable in datasetAge≤50, >50DisaggregatedHospital and TCGANodal state (lymph nodes affected)0, 1, 2-3, 4-9, +90, 1, 2-3, 4-9, +9Hospital and TCGATumor stage (tumor size in mm)0, 0-20, 20-50, >50<10, 10-20, 20-30, >30HospitalKi67 concentration≤14, >14<10, 10-20, >20HospitalLymph nodes removed——HospitalWe know that the proper functioning of a clustering algorithm depends largely on the spatial distribution of the data. In the Hospital dataset and TCGA dataset, we can see that the distribution of the variables to cluster is within normality and we do not have to use any specific algorithm that adapts to themselves. For these distributions, we will use the general-purpose algorithms K-means and hierarchical, evaluating them previously to see which one is best suited in each case.To decide the number of clusters and algorithm used in each variable, we will follow the following procedure:(1)
View the silhouette index and elbow method values for eachk∈1,10(2)
See, for each value ofk (in a set more reduced to the previous one) and algorithm, the values of silhouette index, Dunn index, and connectivity. Here, we will see, according to each index, the number of clusters and the most suitable method for the variable in question(3)
In case the choice is hierarchical, we evaluate the silhouette index for the different measure average, complete and single(4)
Once the number of clusters and algorithm have been decided, we make the partitions, check that there are no excessively unbalanced levels, and visualize them in the distribution histogram


### 2.3. Cluster Hospital

(i)
Age: K-means withk=4; (0.44], (44.56], (56.69], and (69,100] contain 134, 249, 266, and 178 records, respectively(ii)
Lymph nodes affected: K-means withk=2; [0,4] and (4,25] contain 743 and 84 records, respectively. Hierarchical with 2 clusters in addition to separating the value 0 and single measure; 0, (0,10], and (10,25] contain 415, 349, and 27 records, respectively(iii)
Lymph nodes extracted: hierarchical with 4 clusters and average size; [0,1], (1,11], (11,17], and (17,32] contain 183, 290, 222, and 131 records, respectively(iv)
Tumor size: hierarchical with 2 clusters and average size; (0,27] and (27,60] contain 672 and 155 records, respectively. K-means withk=3; (0,12], (12,31], and (31,58] contain 373, 328, and 126 records, respectively(v)
Ki67: hierarchical with 7 clusters and average measure; (0.11], (11.20], (20.31], (31.40], (40.49], (49.56], and (56.63]) contain 262, 182, 131, 76, 100, 39, and 37 records, respectivelyTCGA clusters(i)
Age: K-means withk=4; (0.45], (45.57], (57.70], and (70.100] contain 105.202, 211, and 130 records, respectively. K-means with k=3; (0.54], (54.70], and (70,100] contain 263, 255, and 130 records, respectively(ii)
Lymph nodes affected: K-means withk=4; [0,5], (5,12], (12,21], and (21,44] contain 319, 126, 130, and 73 records, respectively. K-means with k=3 in addition to the value 0; 0, (0,8], (8,19], and (19,44] contain 95, 273, 196, and 84 records, respectivelyFor the variable that indicates the number of affected lymph nodes, due to the high concentration of the value 0 in both sets (55% of the data in Hospital and 15% in TCGA), we have created a single set with this value in addition to those indicated by the algorithm.


### 2.4. Analysis and Choice of Variables

Following the 3 different distributions of numerical variables, we have defined from each initial dataset (Hospital and TCGA) and having in common the categorical variables, 3 different datasets:Standard: contains the numerical variables corresponding to the standard grouping (defined in Table 1). Only for the Hospital complex.Combined: for each numerical variable, we will choose a stratification between standard, paper, and defined by cluster algorithms based on the p value and 95% CI given by Kaplan-Meier and Cox PH.Once the different datasets referring to the two original datasets are formed, we will evaluate whether they fulfill the Cox proportional hazards test and the Cox test of global significance of variables, thus being able to choose the combination of more variables suitable for each outfit. All the statistical measures and tests were mentioned. The statistical methods (Cox PH and Kaplan-Meier).


### 2.5. Hospital Set

#### 2.5.1. Statistical Analysis of Stratifications

For all cases, although the ones with the lowestp value according to both estimators are disaggregated, their confidence intervals are very wide, so we will discard them as quality options. In the following, we see the stratifications of each variable ordered from highest to lowest quality contributed to the set, the first being the one chosen to form part of the combined dataset. For this classification, we are based on the values in Table 2.
(i)
Age: K-meansk=4, standard(ii)
Lymph nodes affected: hierarchicalk=3, paper and standard, K-means k=2(iii)
Lymph nodes extracted: hierarchicalk=4(iv)
Tumor size: paper, K-meansk=3, standard, hierarchical k=2(v)
Ki67: paper, standard, hierarchicalk=7Table 2
Summary datasets.
DatasetNumber of recordsNumber of predictive variablesNumber of records censoredMaximum event timeEvent meaningHospital87412738 (89%)26 yearsRecurrenceTCGA6488584 (90%)13 yearsDeath


#### 2.5.2. Cox Proportional Hazards Test

One of the assumptions made by this model is the proportionality of risks. We will check if our sets comply with it, having to discard them otherwise. We are based from the beginning on the null hypothesis that proportionality is fulfilled. In case the globalp value is less than 0.05, we will have to discard this hypothesis and accept that it is not fulfilled.In Table3, we can see that proportionality is fulfilled for the three sets. We can also see that according to the Chi estimator, none reject the independence hypothesis, although the one most likely to do so would be paper.Table 3
Hospital variable quality analysis fromp value and 95% CI.
Variablep value Kaplan-MeierKaplan-Meier 95% CIp value Cox PHDisaggregated age<0.00010.576-0.9990.4Standard age0.860.854-0.9330.9Age K-meansk=40.370.831-0.9430.4Disaggregated affected lymph nodes<0.00010.725-0.960.005Standard and paper affected nodes<0.00010.771-0.942<0.0001Lymph nodes affected K-meansk=20.00630.843-0.9290.01Hierarchical lymph nodesk=3<0.00010.811-0.927<0.0001Lymph nodes removed disaggregated0.00050.642-0.9870.005Hierarchical nodesk=40.0740.825-0.9370.06Disaggregated tumor size<0.00010.648-0.9820.1Standard tumor size0.070.838-0.9350.08Tumor paper size0.0270.823-0.9390.03Hierarchical tumor sizek=200.20.852-0.9320.2Tumor size K-meansk=30.070.837-0.9360.07Ki67 disaggregated<0.00010.642-0.9880.5Ki67 standard0.460.854-0.9330.5Ki67 paper0.440.841-0.9430.5Ki67 hierarchicalk=70.68—0.7Hormone receptor0.790.855-0.9310.8Menopausal state0.710.855-0.93310.7Degree0.430.842-0.9350.4Cancer subtype0.290.854-0.9330.3Risk0.00010.825-0.919<0.0001Hormone therapy0.0110.836-0.9430.02


#### 2.5.3. Cox Global Significance Test

The results are the same for the LogRank and likelihood tests. We found a slight difference in the Wald test in favor of the combined set, indicating that this set of variables is more significant. We can see it in Tables3 and 4.Table 4
Hospital joint Cox proportional hazards test.
SetRho global estimatorGlobal Chi estimatorGlobalp valueStandard0.0370.541PaperNA0.381CombinedNA0.51For this reason, the combination of variables chosen to represent the Hospital set is combined.


### 2.6. TCGA Set

#### 2.6.1. Statistical Analysis of Stratifications

Age: K-meansk=3, K-means k=4, standard.Lymph nodes affected: K-meansk=3, standard, K-means k=4.We see the details of this classification in Table5.Table 5
Tests global significance variables Cox PH model sets Hospital.
SetGlobal likelihood testWald global testGlobal LogRank testStandard<2-160.9<2-16Paper<2-160.9<2-16Combined<2-161<2-16


#### 2.6.2. Cox PH Proportional Hazards Test

After doing the test the first time, we had to eliminate the variable stage because it did not fulfill the independence of time. In addition, it had a very lowp value that unbalanced the mean making the global one have a value of 1. Once this variable has been eliminated, although the p value is the same for the two sets, the Chi estimator tells us that in standard rejects the null hypothesis of independence of variables. Combined, however, it does have a set of variables that provide different information (Table 6).Table 6
Quality analysis of TCGA variables fromp value and 95% CI.
Variablep value Kaplan-Meier95% CI Kaplan-Meierp value Cox PHDisaggregated age<0.00010.489-1<0.0001Standard age0.00140.82-0.930.0004Age K-meansk=3<0.00010.789-0.95<0.0001Age K-meansk=4<0.00010.777-0.955<0.0001Disaggregated affected lymph nodes0.540.612-0.9980.4Standard and paper affected nodes0.0060.788-0.9650.02Lymph nodes affected K-meansk=3+neg0.0010.785-0.9670.004Lymph nodes affected K-meansk=40.610.796-0.9620.6Menopausal state<0.00010.816-0.924<0.0001Tumor stage0.000290.809-0.9420.001Tumor stage<0.00010.788-0.960.01Hormone receptor0.440.803-0.9490.5Cancer subtype0.180.798-0.9580.2


#### 2.6.3. Cox PH Global Significance Test

In the Wald test (against a coincidence of values in LogRank and likelihood), we confirm that combined has more global significance than standard (Table6).For this reason, the combination of variables chosen to represent the TCGA set is combined.Correlation and hypothesis. Using the Spearman 2.1.4 correlation coefficient, we will see the association strength of the variables to check if it is convenient to eliminate some that are highly correlated with another from the final set. We will study the hypotheses of the possible correlations observed by the Spearman index. Hypothesis tests are performed using the survdiff function [9] that evaluates the difference between survival curves. We understand H0 as the independence of variables.Hospital complex. We see the correlations and the corresponding result of the hypothesis test in Table 7. The independence test is not fulfilled for tumor size and risk, yet we decided not to eliminate them because the correlation index is not too high (0.51) and both have some correlation with the event variable as shown in Table 8. We did not observe any significant inverse correlation.Table 7
Impact index, standard error, risk index,p value, and 95% confidence intervals using the Cox model in conjunction with TCGA.
VariableImpact coefficientHazard ratioStandard errorp value95% CI (RH)Premenopausal1.353.83.1680.667e−03 (1.930e+03)Luminal A-1.050.3447090.990 (Inf)Luminal B1.640.1947090.990 (Inf)Stage II tumor-0.970.372.890.731.294e−031.105e+02Stage III tumor-0.160.852.540.945.852e−031.238e+02Stage IV tumor-7.276.90E−042.00E+040.990(Inf)Hormone receptor EP-1.180.32.360.623.011e−033.132e+01Hormone receptor other-2.940.0547090.990(Inf)Hormone TN receptor-2.670.0747090.990 (Inf)Age (54.70]-0.480.613.750.893.871e−049.709e+02Age (70,100]0.081.083.290.971.693e−037.004e+02Nodal status (0.8]1.434.192.30.534.58e+023.83e+02Nodal status (19.44]1.33.682.380.583.446e−0263.931e+02Nodal status (8.19]0.351.422.20.871.798e−021.132e+02Table 8
Hospital correlation hypothesis tests.
Observed correlationCorrelation indexp value testHypothesisNodal state and risk0.820.06H0Age and menopausal status0.750.3H0Tumor size and risk0.510.004H1TCGA set. We see the correlations and the corresponding result of the hypothesis test in Table9. By the hypothesis test, we accept the correlation between menopause and age, but as before, at not be a correlation with too high an index, and in this case having a very small total number of variables, we will not eliminate any of them.Table 9
Tests of hypothesis TCGA correlations.
Observed correlationCorrelation indexp value testHypothesisCancer subtype and hormone receptor0.430.6H0Menopause and age-0.670.002H1Final sets Hospital set: Tables10 and 11.Table 10
Kaplan-Meier survival adjustment of the Hospital set and TCGA.
nEventsMedianSD averageMedian95% CIHospital8268821.820.42NANATCGA6486410.030.4110.239.51Table 11
Impact index, standard error, risk index,p value, and 95% confidence intervals using the Cox model as a whole Hospital.
VariableImpact coefficientHazard ratioStandard errorp value95% CI (RH)Postmenopausal-3.540.286.080.561.9e−07 (4370)Luminal B-0.760.463.140.819.8e+04 (222)Intermediate risk-0.590.550.890.881.6e+04 (222)High risk-2.151.976.520.743.2e−07 (1850)Tamoxifen-2.350.123.390.491.2e−044.15e+04Tamoxifen-IA-1.730.184.010.666.8e−05 (73.3)Tumor size (10.20]-2.090.123.810.587.05e−5 (218)Tumor size (20,30]0.221.255.010.967.05e−052.29e+04Tumor size (30,100]-2.180.114.380.626.81e−05 (602)Ki67 borderline2.057.784.920.684.98e−041.21e+05Ki67 high2.118.234.040.60.003227e+04Hormone receptor EP + RP1.484.3940.7117301.11e+04Age (44.56]2.168.665.630.71.37e−045.45e+05Age (56.69]3.4832.356.410.581.13e−049.23e+06Age (69,100]3.7643.118.40.653.03e−066.13e+08Nodal status (0.10]0.882.414.490.843.66e−041.58e+04Nodal status (10.25]1.353.876.50.831.13e−051.31e+06gg extracted (1.11]1.052.844.420.814.86e−041.66e+04gg extracted (11.17]1.273.574.570.784.60e−042.77e+04gg extracted (17.32]8.171.085.610.981.82e−056.46e+04The median survival rate is zero because survival never reaches the value 0.5 (50%), always remaining above.In none of the sets, the significance of any variable stands out.TCGA set: Tables10 and 11.


### 2.7. Study of the Effects of Chemotherapy and Hormone Therapy

The first task that we carried out as part of this project was an analysis of survival and the performance utility of hormonal therapy and chemotherapy requested by the doctor who provided us with the data for the Hospital set.For this reason, this task is carried out only with the original (and cleaned) variables of this set and the corresponding groupings of the paper with which the results are compared [10].


#### 2.7.1. Utility or Performance Assessment Measures

RR: relative risk of death of patients receiving treatment relative to those exposed to treatment not exposed to treatment.RR: relative risk reduction. The percentage that the treatment reduces the risk of death.RRR=1−RR∗100.RRI: relative increase in risk.RRI=ARI.ARR: absolute risk reduction, percentage of people in whom death can be avoided by applying the treatment.ARR=notexposedtotreatment−exposedtotreatment∗100.NNT: necessary number of patients to treat to reduce an event (recurrence).NNT=1.ARI: absolute increase in risk.ARI=experimentalrate−controlgrouprate.NNH: number of patients that need to be treated for a patient to suffer an adverse event.NNH=1.


#### 2.7.2. Chemotherapy Performance

As we can see in Table7 and as observed in the paper, exposure to chemotherapy increases the death rate significantly, the more severe the patient is. Table 12 shows that chemotherapy does not reduce the risk of death, but quite the contrary, for this reason, it does not make sense to calculate the necessary number of patients to expose to chemotherapy to reduce an event (NNT).Table 12
Death rate by risk group according to exposure to joint chemotherapy Hospital.
Risk groupExposed chemotherapyUnexposed chemotherapyGlobal14%5.90%Low6%5.40%Intermediate7.70%5.50%High19%7.40%We see in Table13 that in the Kaplan-Meier method, we reject the hypothesis that chemotherapy treatment does not cause effects on survival with a value=3e−04. With the Cox estimator, we see that the chemotherapy variable has an impact coefficient of 0 and 84, a risk index of 2.33 with a standard error of 0.24, and a p value of 0.0004.Table 13
Assessment of the utility of exposure to chemotherapy.
Risk groupRRRNNTLow-10.90%-167Intermediate-36.50%-49High-157.30%-9


#### 2.7.3. Hormone Therapy Performance

With the minimum positive number of patients to be treated to avoid a case of recurrence, we have aromatase inhibitors (AI) as the best treatment, followed by this combined with Tamoxifen. Table14. At the doctor’s recommendation, we stopped working with the chemotherapy variable from the beginning.Table 14
Acceptance of hormone therapy treatments.
Hormone therapy treatmentControl group rateExperimental group rateNNTNNHAI0.1060.10519-19Tamoxifen0.1010.121-5353AI+Tamoxifen0.1080.04530-30


### 2.8. Proposal of Hormonal Treatment Based on the Expiration

#### 2.8.1. Data Replication

Machine learning algorithms learn by understanding the relationship between the predictor variables and the variable to predict in order to create a pattern. Furthermore, whatever the size of the data, it is a small fraction of the global population, and in nature, there are always fluctuations that differ from a strict pattern. Our objective is to find the pattern of the entire population with a sample of sizeN, and the larger N, the smaller the differences with the overall population.Our two sets of 827 and 648 records are very small and insufficient to represent the global population, so it is necessary to replicate them before they can be used to train a model.


#### 2.8.2. The Data Replication Algorithm Designed Consists of, for each Record

Its event and tracking time (in months) is stored. A start time and an interval are assigned according to the follow-up time: if it is greater than 10 months, the start time will be 10 months prior to that month; if not, it will be 0. The interval will be one day, each part of the difference between the end time and follow-time.(i)
From its defined start time to follow-up time and with interval 4 if it is the Hospital dataset or 3 if it is the TCGA dataset, the rest of the variables will be replicated with the unobserved event for each time(ii)
If the event has taken place (event=1), from follow-up time to the maximum time of that set and with the calculated interval, the rest of the variables are replicatedThe main idea is that a patient with timet∈0,T had not suffered the event in time ti≤t, and if he has suffered it at time t, he would also have suffered it for a time ti≥t. In the records that replicate in backward time, they only do so up to a proportional time, and those that go to the end also do so with an interval proportional to their position. In addition, we have made the interval that replicates the data with event=1 smaller to reduce the possibly problematic initial bias of the event variable. As we can see in the graphs contained in the annexed documents of the project and not exposed here because there are too many, the frequency distributions of all the variables are kept almost perfectly for both sets. The most important distribution to maintain is the distribution of events over time. In Table 15, we can see how by maintaining the distributions; we have managed to reduce the censored data by 17% and 12%.Table 15
Joint states before and after replication.
SetInitial sizeSize after replicationInitially censoredCensored after replicationHospital8273422738 (89%)2454 (72%)TCGA6483137584 (90%)2433 (78%)


#### 2.8.3. Usingmlr: Choice of Predictor Type

Having the data ready to use a prediction model, we will do an exploration to find out which type of predictor is the most appropriate. We will explore the functioning of survival-type predictors (those used in a standard way in this type of study) and predictors of probability classification. The latter, for each level of the variable to be predicted (0 or 1), will calculate its probability and return the most probable as prediction.For this exploration, we will use themlr package for R [11]. This package (acronym for machine learning in r) provides an infrastructure that, using resampling methods, evaluates the indicated algorithms making an internal adjustment to find the best hyperparameters in each case.To use this framework, we introduce the task and learner concepts. The tasks encapsulate the data and information about it necessary for the machine learning algorithm. We will create them with the functions makeSurvTask () indicating the tracking time variable and the event and makeClassifTask () indicating the variable event-to and the level that defines the survival. The learners contain the properties of the methods, we create them with the makeLearner () function, and we will indicate the algorithm and type of prediction in each case. We will also define the characteristics of the resampling strategy with the makeResampleDesc () function. In our case, we have chosen cross-validation withk=5. Finally, with the function resample (learner, task, and resampling) indicating the parameters created previously, we will obtain the mean validation measures of the validation set in the iterations of the resampling algorithm. For both sets, we will test their available algorithms in each case.


#### 2.8.4. Survival Predictors

We evaluate it with the measure C-index 2.2.3. As we have seen in the explanation of this metric, a value less than 0.7 defines the model as very weak and inconsistent. None of the algorithms give good results, and the ones that are somewhat better have a high execution time. The TCGA set performs better on this type of predictor than the Hospital set. We can see the results in Table16.Table 16
Survival classifier results usingmlr Hospital and TCGA.
AlgorithmC-indexExecution timeHospitalCV CoxBoost0.588.6 minCoxBoost0.581.8 minCoxPH0.571 secCV Glmnet0.56 secsTCGACV CoxBoost0.77.2 minCoxBoost0.6926 secsCoxPH0.680.2 secsCV Glmnet0.624 secs


#### 2.8.5. Predictor Probability Classification

We evaluate them with measures ACC and MMCE 3.2.1. In these predictors, we also agree on the best performance over the TCGA set, although for both sets the results are notably better than those of the survival predictors, and they present more stable execution times between the different algorithms. We can see the results in Table17. We highlight the good performance of the Bart machine algorithm (Bayesian additive regression trees) over the rest, so we will focus on exploring the algorithms derived from decision trees (random forest and gradient boosting).Table 17
Classifying results classification usingmlr Hospital and TCGA.
AlgorithmACCMMCEExecution timeHospitalBart machine0.880.121.3 minsAdaBoost machine0.830.170.32 secsBinomial0.850.150.2 secsCGTABart machine0.990.162 secsAdaBoost machine0.890.110.3 secsBinomial0.820.140.7 secs


#### 2.8.6. Usingh2o

Exploratory analysis of classification models: once we know from the previous step that we are going to use predictors of the probabilistic classification type, we will use theh2o library in R [12]. This open platform offers parallel implementations of computational learning algorithms. We will use it to automate the training process of the algorithms (deep learning, random forest, gradient boosting machine, and extreme gradient boosting machine). In the previous section, we have seen the good performance of the algorithms derived from decision trees, but we will also check the behavior of the well-known deep learning algorithm.As in the analysis in the previous section, we will also evaluate the mean measures of the validation set in a cross-validationk=5. These measures will be calculated from the difference between the predictions. On returned (0 or 1) with the actual event value. Once we have validated a model, as this is a probabilistic type, we will be able to access the probability that the output is 0, that is, the probability of survival. Are probabilities for the different times will define a survival curve? Given that the unbalance in the levels in the variable to be predicted is remarkable, as we have seen in Table 15 and Figure 1, we will test the models with the balanced and unbalanced event variable for both sets.Figure 1
Interface preview (∗CTS5 refers to the Hospital set).


#### 2.8.7. Hormone Therapy Decision Based on Predicted Survival

Using the Shiny extension for R, we will create an interface. In this interface, it is possible to enter the clinical data of the patient available in each set in the form of the finally chosen groupings, in addition to a fixed time. Making use of the models finally chosen and validated for each set, we will predict for the data entered the probability of survival (of which event has the value 0) for each time, returning a survival curve. In the case of the Hospital group, in which we have had the hormone therapy variable with the values IA, Tamoxifen, and Tamoxifen+IA for training, we will be able to see differentiated survival curves for each of the treatments, thus being able to know which is the one that maximizes survival in each particular case. The exact survival values for the fixed time entered will also be returned.


## 2.1. Methods

The objective is to find predictors of survival for each dataset and to be able to visualize the curves predicted from input variables in an interface. The first step is to prepare the data; for this, using statistical methods, we will evaluate which stratification is more adequate. It is the next step to cleaning data and essential for the proper functioning of machine learning algorithms. We will apply correlation analysis and confirm this by hypothesis tests in case it is necessary to eliminate any of this final set.


## 2.2. Variable Creation

The groupings that we will build and evaluate, in addition to those defined by the clustering algorithms, will be, in the variables that allow it, those defined by the paper that we replicate as the first task of this project [8] and those commonly used in medical practice. We can see them in Table 1.Table 1
Variable numerical aggregations.
VariableStandard groupingGrouping paperApplicable and clusterisable in datasetAge≤50, >50DisaggregatedHospital and TCGANodal state (lymph nodes affected)0, 1, 2-3, 4-9, +90, 1, 2-3, 4-9, +9Hospital and TCGATumor stage (tumor size in mm)0, 0-20, 20-50, >50<10, 10-20, 20-30, >30HospitalKi67 concentration≤14, >14<10, 10-20, >20HospitalLymph nodes removed——HospitalWe know that the proper functioning of a clustering algorithm depends largely on the spatial distribution of the data. In the Hospital dataset and TCGA dataset, we can see that the distribution of the variables to cluster is within normality and we do not have to use any specific algorithm that adapts to themselves. For these distributions, we will use the general-purpose algorithms K-means and hierarchical, evaluating them previously to see which one is best suited in each case.To decide the number of clusters and algorithm used in each variable, we will follow the following procedure:(1)
View the silhouette index and elbow method values for eachk∈1,10(2)
See, for each value ofk (in a set more reduced to the previous one) and algorithm, the values of silhouette index, Dunn index, and connectivity. Here, we will see, according to each index, the number of clusters and the most suitable method for the variable in question(3)
In case the choice is hierarchical, we evaluate the silhouette index for the different measure average, complete and single(4)
Once the number of clusters and algorithm have been decided, we make the partitions, check that there are no excessively unbalanced levels, and visualize them in the distribution histogram


## 2.3. Cluster Hospital

(i)
Age: K-means withk=4; (0.44], (44.56], (56.69], and (69,100] contain 134, 249, 266, and 178 records, respectively(ii)
Lymph nodes affected: K-means withk=2; [0,4] and (4,25] contain 743 and 84 records, respectively. Hierarchical with 2 clusters in addition to separating the value 0 and single measure; 0, (0,10], and (10,25] contain 415, 349, and 27 records, respectively(iii)
Lymph nodes extracted: hierarchical with 4 clusters and average size; [0,1], (1,11], (11,17], and (17,32] contain 183, 290, 222, and 131 records, respectively(iv)
Tumor size: hierarchical with 2 clusters and average size; (0,27] and (27,60] contain 672 and 155 records, respectively. K-means withk=3; (0,12], (12,31], and (31,58] contain 373, 328, and 126 records, respectively(v)
Ki67: hierarchical with 7 clusters and average measure; (0.11], (11.20], (20.31], (31.40], (40.49], (49.56], and (56.63]) contain 262, 182, 131, 76, 100, 39, and 37 records, respectivelyTCGA clusters(i)
Age: K-means withk=4; (0.45], (45.57], (57.70], and (70.100] contain 105.202, 211, and 130 records, respectively. K-means with k=3; (0.54], (54.70], and (70,100] contain 263, 255, and 130 records, respectively(ii)
Lymph nodes affected: K-means withk=4; [0,5], (5,12], (12,21], and (21,44] contain 319, 126, 130, and 73 records, respectively. K-means with k=3 in addition to the value 0; 0, (0,8], (8,19], and (19,44] contain 95, 273, 196, and 84 records, respectivelyFor the variable that indicates the number of affected lymph nodes, due to the high concentration of the value 0 in both sets (55% of the data in Hospital and 15% in TCGA), we have created a single set with this value in addition to those indicated by the algorithm.


## 2.4. Analysis and Choice of Variables

Following the 3 different distributions of numerical variables, we have defined from each initial dataset (Hospital and TCGA) and having in common the categorical variables, 3 different datasets:Standard: contains the numerical variables corresponding to the standard grouping (defined in Table 1). Only for the Hospital complex.Combined: for each numerical variable, we will choose a stratification between standard, paper, and defined by cluster algorithms based on the p value and 95% CI given by Kaplan-Meier and Cox PH.Once the different datasets referring to the two original datasets are formed, we will evaluate whether they fulfill the Cox proportional hazards test and the Cox test of global significance of variables, thus being able to choose the combination of more variables suitable for each outfit. All the statistical measures and tests were mentioned. The statistical methods (Cox PH and Kaplan-Meier).


## 2.5. Hospital Set

### 2.5.1. Statistical Analysis of Stratifications

For all cases, although the ones with the lowestp value according to both estimators are disaggregated, their confidence intervals are very wide, so we will discard them as quality options. In the following, we see the stratifications of each variable ordered from highest to lowest quality contributed to the set, the first being the one chosen to form part of the combined dataset. For this classification, we are based on the values in Table 2.
(i)
Age: K-meansk=4, standard(ii)
Lymph nodes affected: hierarchicalk=3, paper and standard, K-means k=2(iii)
Lymph nodes extracted: hierarchicalk=4(iv)
Tumor size: paper, K-meansk=3, standard, hierarchical k=2(v)
Ki67: paper, standard, hierarchicalk=7Table 2
Summary datasets.
DatasetNumber of recordsNumber of predictive variablesNumber of records censoredMaximum event timeEvent meaningHospital87412738 (89%)26 yearsRecurrenceTCGA6488584 (90%)13 yearsDeath


### 2.5.2. Cox Proportional Hazards Test

One of the assumptions made by this model is the proportionality of risks. We will check if our sets comply with it, having to discard them otherwise. We are based from the beginning on the null hypothesis that proportionality is fulfilled. In case the globalp value is less than 0.05, we will have to discard this hypothesis and accept that it is not fulfilled.In Table3, we can see that proportionality is fulfilled for the three sets. We can also see that according to the Chi estimator, none reject the independence hypothesis, although the one most likely to do so would be paper.Table 3
Hospital variable quality analysis fromp value and 95% CI.
Variablep value Kaplan-MeierKaplan-Meier 95% CIp value Cox PHDisaggregated age<0.00010.576-0.9990.4Standard age0.860.854-0.9330.9Age K-meansk=40.370.831-0.9430.4Disaggregated affected lymph nodes<0.00010.725-0.960.005Standard and paper affected nodes<0.00010.771-0.942<0.0001Lymph nodes affected K-meansk=20.00630.843-0.9290.01Hierarchical lymph nodesk=3<0.00010.811-0.927<0.0001Lymph nodes removed disaggregated0.00050.642-0.9870.005Hierarchical nodesk=40.0740.825-0.9370.06Disaggregated tumor size<0.00010.648-0.9820.1Standard tumor size0.070.838-0.9350.08Tumor paper size0.0270.823-0.9390.03Hierarchical tumor sizek=200.20.852-0.9320.2Tumor size K-meansk=30.070.837-0.9360.07Ki67 disaggregated<0.00010.642-0.9880.5Ki67 standard0.460.854-0.9330.5Ki67 paper0.440.841-0.9430.5Ki67 hierarchicalk=70.68—0.7Hormone receptor0.790.855-0.9310.8Menopausal state0.710.855-0.93310.7Degree0.430.842-0.9350.4Cancer subtype0.290.854-0.9330.3Risk0.00010.825-0.919<0.0001Hormone therapy0.0110.836-0.9430.02


### 2.5.3. Cox Global Significance Test

The results are the same for the LogRank and likelihood tests. We found a slight difference in the Wald test in favor of the combined set, indicating that this set of variables is more significant. We can see it in Tables3 and 4.Table 4
Hospital joint Cox proportional hazards test.
SetRho global estimatorGlobal Chi estimatorGlobalp valueStandard0.0370.541PaperNA0.381CombinedNA0.51For this reason, the combination of variables chosen to represent the Hospital set is combined.


## 2.5.1. Statistical Analysis of Stratifications

For all cases, although the ones with the lowestp value according to both estimators are disaggregated, their confidence intervals are very wide, so we will discard them as quality options. In the following, we see the stratifications of each variable ordered from highest to lowest quality contributed to the set, the first being the one chosen to form part of the combined dataset. For this classification, we are based on the values in Table 2.
(i)
Age: K-meansk=4, standard(ii)
Lymph nodes affected: hierarchicalk=3, paper and standard, K-means k=2(iii)
Lymph nodes extracted: hierarchicalk=4(iv)
Tumor size: paper, K-meansk=3, standard, hierarchical k=2(v)
Ki67: paper, standard, hierarchicalk=7Table 2
Summary datasets.
DatasetNumber of recordsNumber of predictive variablesNumber of records censoredMaximum event timeEvent meaningHospital87412738 (89%)26 yearsRecurrenceTCGA6488584 (90%)13 yearsDeath


## 2.5.2. Cox Proportional Hazards Test

One of the assumptions made by this model is the proportionality of risks. We will check if our sets comply with it, having to discard them otherwise. We are based from the beginning on the null hypothesis that proportionality is fulfilled. In case the globalp value is less than 0.05, we will have to discard this hypothesis and accept that it is not fulfilled.In Table3, we can see that proportionality is fulfilled for the three sets. We can also see that according to the Chi estimator, none reject the independence hypothesis, although the one most likely to do so would be paper.Table 3
Hospital variable quality analysis fromp value and 95% CI.
Variablep value Kaplan-MeierKaplan-Meier 95% CIp value Cox PHDisaggregated age<0.00010.576-0.9990.4Standard age0.860.854-0.9330.9Age K-meansk=40.370.831-0.9430.4Disaggregated affected lymph nodes<0.00010.725-0.960.005Standard and paper affected nodes<0.00010.771-0.942<0.0001Lymph nodes affected K-meansk=20.00630.843-0.9290.01Hierarchical lymph nodesk=3<0.00010.811-0.927<0.0001Lymph nodes removed disaggregated0.00050.642-0.9870.005Hierarchical nodesk=40.0740.825-0.9370.06Disaggregated tumor size<0.00010.648-0.9820.1Standard tumor size0.070.838-0.9350.08Tumor paper size0.0270.823-0.9390.03Hierarchical tumor sizek=200.20.852-0.9320.2Tumor size K-meansk=30.070.837-0.9360.07Ki67 disaggregated<0.00010.642-0.9880.5Ki67 standard0.460.854-0.9330.5Ki67 paper0.440.841-0.9430.5Ki67 hierarchicalk=70.68—0.7Hormone receptor0.790.855-0.9310.8Menopausal state0.710.855-0.93310.7Degree0.430.842-0.9350.4Cancer subtype0.290.854-0.9330.3Risk0.00010.825-0.919<0.0001Hormone therapy0.0110.836-0.9430.02


## 2.5.3. Cox Global Significance Test

The results are the same for the LogRank and likelihood tests. We found a slight difference in the Wald test in favor of the combined set, indicating that this set of variables is more significant. We can see it in Tables3 and 4.Table 4
Hospital joint Cox proportional hazards test.
SetRho global estimatorGlobal Chi estimatorGlobalp valueStandard0.0370.541PaperNA0.381CombinedNA0.51For this reason, the combination of variables chosen to represent the Hospital set is combined.


## 2.6. TCGA Set

### 2.6.1. Statistical Analysis of Stratifications

Age: K-meansk=3, K-means k=4, standard.Lymph nodes affected: K-meansk=3, standard, K-means k=4.We see the details of this classification in Table5.Table 5
Tests global significance variables Cox PH model sets Hospital.
SetGlobal likelihood testWald global testGlobal LogRank testStandard<2-160.9<2-16Paper<2-160.9<2-16Combined<2-161<2-16


### 2.6.2. Cox PH Proportional Hazards Test

After doing the test the first time, we had to eliminate the variable stage because it did not fulfill the independence of time. In addition, it had a very lowp value that unbalanced the mean making the global one have a value of 1. Once this variable has been eliminated, although the p value is the same for the two sets, the Chi estimator tells us that in standard rejects the null hypothesis of independence of variables. Combined, however, it does have a set of variables that provide different information (Table 6).Table 6
Quality analysis of TCGA variables fromp value and 95% CI.
Variablep value Kaplan-Meier95% CI Kaplan-Meierp value Cox PHDisaggregated age<0.00010.489-1<0.0001Standard age0.00140.82-0.930.0004Age K-meansk=3<0.00010.789-0.95<0.0001Age K-meansk=4<0.00010.777-0.955<0.0001Disaggregated affected lymph nodes0.540.612-0.9980.4Standard and paper affected nodes0.0060.788-0.9650.02Lymph nodes affected K-meansk=3+neg0.0010.785-0.9670.004Lymph nodes affected K-meansk=40.610.796-0.9620.6Menopausal state<0.00010.816-0.924<0.0001Tumor stage0.000290.809-0.9420.001Tumor stage<0.00010.788-0.960.01Hormone receptor0.440.803-0.9490.5Cancer subtype0.180.798-0.9580.2


### 2.6.3. Cox PH Global Significance Test

In the Wald test (against a coincidence of values in LogRank and likelihood), we confirm that combined has more global significance than standard (Table6).For this reason, the combination of variables chosen to represent the TCGA set is combined.Correlation and hypothesis. Using the Spearman 2.1.4 correlation coefficient, we will see the association strength of the variables to check if it is convenient to eliminate some that are highly correlated with another from the final set. We will study the hypotheses of the possible correlations observed by the Spearman index. Hypothesis tests are performed using the survdiff function [9] that evaluates the difference between survival curves. We understand H0 as the independence of variables.Hospital complex. We see the correlations and the corresponding result of the hypothesis test in Table 7. The independence test is not fulfilled for tumor size and risk, yet we decided not to eliminate them because the correlation index is not too high (0.51) and both have some correlation with the event variable as shown in Table 8. We did not observe any significant inverse correlation.Table 7
Impact index, standard error, risk index,p value, and 95% confidence intervals using the Cox model in conjunction with TCGA.
VariableImpact coefficientHazard ratioStandard errorp value95% CI (RH)Premenopausal1.353.83.1680.667e−03 (1.930e+03)Luminal A-1.050.3447090.990 (Inf)Luminal B1.640.1947090.990 (Inf)Stage II tumor-0.970.372.890.731.294e−031.105e+02Stage III tumor-0.160.852.540.945.852e−031.238e+02Stage IV tumor-7.276.90E−042.00E+040.990(Inf)Hormone receptor EP-1.180.32.360.623.011e−033.132e+01Hormone receptor other-2.940.0547090.990(Inf)Hormone TN receptor-2.670.0747090.990 (Inf)Age (54.70]-0.480.613.750.893.871e−049.709e+02Age (70,100]0.081.083.290.971.693e−037.004e+02Nodal status (0.8]1.434.192.30.534.58e+023.83e+02Nodal status (19.44]1.33.682.380.583.446e−0263.931e+02Nodal status (8.19]0.351.422.20.871.798e−021.132e+02Table 8
Hospital correlation hypothesis tests.
Observed correlationCorrelation indexp value testHypothesisNodal state and risk0.820.06H0Age and menopausal status0.750.3H0Tumor size and risk0.510.004H1TCGA set. We see the correlations and the corresponding result of the hypothesis test in Table9. By the hypothesis test, we accept the correlation between menopause and age, but as before, at not be a correlation with too high an index, and in this case having a very small total number of variables, we will not eliminate any of them.Table 9
Tests of hypothesis TCGA correlations.
Observed correlationCorrelation indexp value testHypothesisCancer subtype and hormone receptor0.430.6H0Menopause and age-0.670.002H1Final sets Hospital set: Tables10 and 11.Table 10
Kaplan-Meier survival adjustment of the Hospital set and TCGA.
nEventsMedianSD averageMedian95% CIHospital8268821.820.42NANATCGA6486410.030.4110.239.51Table 11
Impact index, standard error, risk index,p value, and 95% confidence intervals using the Cox model as a whole Hospital.
VariableImpact coefficientHazard ratioStandard errorp value95% CI (RH)Postmenopausal-3.540.286.080.561.9e−07 (4370)Luminal B-0.760.463.140.819.8e+04 (222)Intermediate risk-0.590.550.890.881.6e+04 (222)High risk-2.151.976.520.743.2e−07 (1850)Tamoxifen-2.350.123.390.491.2e−044.15e+04Tamoxifen-IA-1.730.184.010.666.8e−05 (73.3)Tumor size (10.20]-2.090.123.810.587.05e−5 (218)Tumor size (20,30]0.221.255.010.967.05e−052.29e+04Tumor size (30,100]-2.180.114.380.626.81e−05 (602)Ki67 borderline2.057.784.920.684.98e−041.21e+05Ki67 high2.118.234.040.60.003227e+04Hormone receptor EP + RP1.484.3940.7117301.11e+04Age (44.56]2.168.665.630.71.37e−045.45e+05Age (56.69]3.4832.356.410.581.13e−049.23e+06Age (69,100]3.7643.118.40.653.03e−066.13e+08Nodal status (0.10]0.882.414.490.843.66e−041.58e+04Nodal status (10.25]1.353.876.50.831.13e−051.31e+06gg extracted (1.11]1.052.844.420.814.86e−041.66e+04gg extracted (11.17]1.273.574.570.784.60e−042.77e+04gg extracted (17.32]8.171.085.610.981.82e−056.46e+04The median survival rate is zero because survival never reaches the value 0.5 (50%), always remaining above.In none of the sets, the significance of any variable stands out.TCGA set: Tables10 and 11.


## 2.6.1. Statistical Analysis of Stratifications

Age: K-meansk=3, K-means k=4, standard.Lymph nodes affected: K-meansk=3, standard, K-means k=4.We see the details of this classification in Table5.Table 5
Tests global significance variables Cox PH model sets Hospital.
SetGlobal likelihood testWald global testGlobal LogRank testStandard<2-160.9<2-16Paper<2-160.9<2-16Combined<2-161<2-16


## 2.6.2. Cox PH Proportional Hazards Test

After doing the test the first time, we had to eliminate the variable stage because it did not fulfill the independence of time. In addition, it had a very lowp value that unbalanced the mean making the global one have a value of 1. Once this variable has been eliminated, although the p value is the same for the two sets, the Chi estimator tells us that in standard rejects the null hypothesis of independence of variables. Combined, however, it does have a set of variables that provide different information (Table 6).Table 6
Quality analysis of TCGA variables fromp value and 95% CI.
Variablep value Kaplan-Meier95% CI Kaplan-Meierp value Cox PHDisaggregated age<0.00010.489-1<0.0001Standard age0.00140.82-0.930.0004Age K-meansk=3<0.00010.789-0.95<0.0001Age K-meansk=4<0.00010.777-0.955<0.0001Disaggregated affected lymph nodes0.540.612-0.9980.4Standard and paper affected nodes0.0060.788-0.9650.02Lymph nodes affected K-meansk=3+neg0.0010.785-0.9670.004Lymph nodes affected K-meansk=40.610.796-0.9620.6Menopausal state<0.00010.816-0.924<0.0001Tumor stage0.000290.809-0.9420.001Tumor stage<0.00010.788-0.960.01Hormone receptor0.440.803-0.9490.5Cancer subtype0.180.798-0.9580.2


## 2.6.3. Cox PH Global Significance Test

In the Wald test (against a coincidence of values in LogRank and likelihood), we confirm that combined has more global significance than standard (Table6).For this reason, the combination of variables chosen to represent the TCGA set is combined.Correlation and hypothesis. Using the Spearman 2.1.4 correlation coefficient, we will see the association strength of the variables to check if it is convenient to eliminate some that are highly correlated with another from the final set. We will study the hypotheses of the possible correlations observed by the Spearman index. Hypothesis tests are performed using the survdiff function [9] that evaluates the difference between survival curves. We understand H0 as the independence of variables.Hospital complex. We see the correlations and the corresponding result of the hypothesis test in Table 7. The independence test is not fulfilled for tumor size and risk, yet we decided not to eliminate them because the correlation index is not too high (0.51) and both have some correlation with the event variable as shown in Table 8. We did not observe any significant inverse correlation.Table 7
Impact index, standard error, risk index,p value, and 95% confidence intervals using the Cox model in conjunction with TCGA.
VariableImpact coefficientHazard ratioStandard errorp value95% CI (RH)Premenopausal1.353.83.1680.667e−03 (1.930e+03)Luminal A-1.050.3447090.990 (Inf)Luminal B1.640.1947090.990 (Inf)Stage II tumor-0.970.372.890.731.294e−031.105e+02Stage III tumor-0.160.852.540.945.852e−031.238e+02Stage IV tumor-7.276.90E−042.00E+040.990(Inf)Hormone receptor EP-1.180.32.360.623.011e−033.132e+01Hormone receptor other-2.940.0547090.990(Inf)Hormone TN receptor-2.670.0747090.990 (Inf)Age (54.70]-0.480.613.750.893.871e−049.709e+02Age (70,100]0.081.083.290.971.693e−037.004e+02Nodal status (0.8]1.434.192.30.534.58e+023.83e+02Nodal status (19.44]1.33.682.380.583.446e−0263.931e+02Nodal status (8.19]0.351.422.20.871.798e−021.132e+02Table 8
Hospital correlation hypothesis tests.
Observed correlationCorrelation indexp value testHypothesisNodal state and risk0.820.06H0Age and menopausal status0.750.3H0Tumor size and risk0.510.004H1TCGA set. We see the correlations and the corresponding result of the hypothesis test in Table9. By the hypothesis test, we accept the correlation between menopause and age, but as before, at not be a correlation with too high an index, and in this case having a very small total number of variables, we will not eliminate any of them.Table 9
Tests of hypothesis TCGA correlations.
Observed correlationCorrelation indexp value testHypothesisCancer subtype and hormone receptor0.430.6H0Menopause and age-0.670.002H1Final sets Hospital set: Tables10 and 11.Table 10
Kaplan-Meier survival adjustment of the Hospital set and TCGA.
nEventsMedianSD averageMedian95% CIHospital8268821.820.42NANATCGA6486410.030.4110.239.51Table 11
Impact index, standard error, risk index,p value, and 95% confidence intervals using the Cox model as a whole Hospital.
VariableImpact coefficientHazard ratioStandard errorp value95% CI (RH)Postmenopausal-3.540.286.080.561.9e−07 (4370)Luminal B-0.760.463.140.819.8e+04 (222)Intermediate risk-0.590.550.890.881.6e+04 (222)High risk-2.151.976.520.743.2e−07 (1850)Tamoxifen-2.350.123.390.491.2e−044.15e+04Tamoxifen-IA-1.730.184.010.666.8e−05 (73.3)Tumor size (10.20]-2.090.123.810.587.05e−5 (218)Tumor size (20,30]0.221.255.010.967.05e−052.29e+04Tumor size (30,100]-2.180.114.380.626.81e−05 (602)Ki67 borderline2.057.784.920.684.98e−041.21e+05Ki67 high2.118.234.040.60.003227e+04Hormone receptor EP + RP1.484.3940.7117301.11e+04Age (44.56]2.168.665.630.71.37e−045.45e+05Age (56.69]3.4832.356.410.581.13e−049.23e+06Age (69,100]3.7643.118.40.653.03e−066.13e+08Nodal status (0.10]0.882.414.490.843.66e−041.58e+04Nodal status (10.25]1.353.876.50.831.13e−051.31e+06gg extracted (1.11]1.052.844.420.814.86e−041.66e+04gg extracted (11.17]1.273.574.570.784.60e−042.77e+04gg extracted (17.32]8.171.085.610.981.82e−056.46e+04The median survival rate is zero because survival never reaches the value 0.5 (50%), always remaining above.In none of the sets, the significance of any variable stands out.TCGA set: Tables10 and 11.


## 2.7. Study of the Effects of Chemotherapy and Hormone Therapy

The first task that we carried out as part of this project was an analysis of survival and the performance utility of hormonal therapy and chemotherapy requested by the doctor who provided us with the data for the Hospital set.For this reason, this task is carried out only with the original (and cleaned) variables of this set and the corresponding groupings of the paper with which the results are compared [10].


### 2.7.1. Utility or Performance Assessment Measures

RR: relative risk of death of patients receiving treatment relative to those exposed to treatment not exposed to treatment.RR: relative risk reduction. The percentage that the treatment reduces the risk of death.RRR=1−RR∗100.RRI: relative increase in risk.RRI=ARI.ARR: absolute risk reduction, percentage of people in whom death can be avoided by applying the treatment.ARR=notexposedtotreatment−exposedtotreatment∗100.NNT: necessary number of patients to treat to reduce an event (recurrence).NNT=1.ARI: absolute increase in risk.ARI=experimentalrate−controlgrouprate.NNH: number of patients that need to be treated for a patient to suffer an adverse event.NNH=1.


### 2.7.2. Chemotherapy Performance

As we can see in Table7 and as observed in the paper, exposure to chemotherapy increases the death rate significantly, the more severe the patient is. Table 12 shows that chemotherapy does not reduce the risk of death, but quite the contrary, for this reason, it does not make sense to calculate the necessary number of patients to expose to chemotherapy to reduce an event (NNT).Table 12
Death rate by risk group according to exposure to joint chemotherapy Hospital.
Risk groupExposed chemotherapyUnexposed chemotherapyGlobal14%5.90%Low6%5.40%Intermediate7.70%5.50%High19%7.40%We see in Table13 that in the Kaplan-Meier method, we reject the hypothesis that chemotherapy treatment does not cause effects on survival with a value=3e−04. With the Cox estimator, we see that the chemotherapy variable has an impact coefficient of 0 and 84, a risk index of 2.33 with a standard error of 0.24, and a p value of 0.0004.Table 13
Assessment of the utility of exposure to chemotherapy.
Risk groupRRRNNTLow-10.90%-167Intermediate-36.50%-49High-157.30%-9


### 2.7.3. Hormone Therapy Performance

With the minimum positive number of patients to be treated to avoid a case of recurrence, we have aromatase inhibitors (AI) as the best treatment, followed by this combined with Tamoxifen. Table14. At the doctor’s recommendation, we stopped working with the chemotherapy variable from the beginning.Table 14
Acceptance of hormone therapy treatments.
Hormone therapy treatmentControl group rateExperimental group rateNNTNNHAI0.1060.10519-19Tamoxifen0.1010.121-5353AI+Tamoxifen0.1080.04530-30


## 2.7.1. Utility or Performance Assessment Measures

RR: relative risk of death of patients receiving treatment relative to those exposed to treatment not exposed to treatment.RR: relative risk reduction. The percentage that the treatment reduces the risk of death.RRR=1−RR∗100.RRI: relative increase in risk.RRI=ARI.ARR: absolute risk reduction, percentage of people in whom death can be avoided by applying the treatment.ARR=notexposedtotreatment−exposedtotreatment∗100.NNT: necessary number of patients to treat to reduce an event (recurrence).NNT=1.ARI: absolute increase in risk.ARI=experimentalrate−controlgrouprate.NNH: number of patients that need to be treated for a patient to suffer an adverse event.NNH=1.


## 2.7.2. Chemotherapy Performance

As we can see in Table7 and as observed in the paper, exposure to chemotherapy increases the death rate significantly, the more severe the patient is. Table 12 shows that chemotherapy does not reduce the risk of death, but quite the contrary, for this reason, it does not make sense to calculate the necessary number of patients to expose to chemotherapy to reduce an event (NNT).Table 12
Death rate by risk group according to exposure to joint chemotherapy Hospital.
Risk groupExposed chemotherapyUnexposed chemotherapyGlobal14%5.90%Low6%5.40%Intermediate7.70%5.50%High19%7.40%We see in Table13 that in the Kaplan-Meier method, we reject the hypothesis that chemotherapy treatment does not cause effects on survival with a value=3e−04. With the Cox estimator, we see that the chemotherapy variable has an impact coefficient of 0 and 84, a risk index of 2.33 with a standard error of 0.24, and a p value of 0.0004.Table 13
Assessment of the utility of exposure to chemotherapy.
Risk groupRRRNNTLow-10.90%-167Intermediate-36.50%-49High-157.30%-9


## 2.7.3. Hormone Therapy Performance

With the minimum positive number of patients to be treated to avoid a case of recurrence, we have aromatase inhibitors (AI) as the best treatment, followed by this combined with Tamoxifen. Table14. At the doctor’s recommendation, we stopped working with the chemotherapy variable from the beginning.Table 14
Acceptance of hormone therapy treatments.
Hormone therapy treatmentControl group rateExperimental group rateNNTNNHAI0.1060.10519-19Tamoxifen0.1010.121-5353AI+Tamoxifen0.1080.04530-30


## 2.8. Proposal of Hormonal Treatment Based on the Expiration

### 2.8.1. Data Replication

Machine learning algorithms learn by understanding the relationship between the predictor variables and the variable to predict in order to create a pattern. Furthermore, whatever the size of the data, it is a small fraction of the global population, and in nature, there are always fluctuations that differ from a strict pattern. Our objective is to find the pattern of the entire population with a sample of sizeN, and the larger N, the smaller the differences with the overall population.Our two sets of 827 and 648 records are very small and insufficient to represent the global population, so it is necessary to replicate them before they can be used to train a model.


### 2.8.2. The Data Replication Algorithm Designed Consists of, for each Record

Its event and tracking time (in months) is stored. A start time and an interval are assigned according to the follow-up time: if it is greater than 10 months, the start time will be 10 months prior to that month; if not, it will be 0. The interval will be one day, each part of the difference between the end time and follow-time.(i)
From its defined start time to follow-up time and with interval 4 if it is the Hospital dataset or 3 if it is the TCGA dataset, the rest of the variables will be replicated with the unobserved event for each time(ii)
If the event has taken place (event=1), from follow-up time to the maximum time of that set and with the calculated interval, the rest of the variables are replicatedThe main idea is that a patient with timet∈0,T had not suffered the event in time ti≤t, and if he has suffered it at time t, he would also have suffered it for a time ti≥t. In the records that replicate in backward time, they only do so up to a proportional time, and those that go to the end also do so with an interval proportional to their position. In addition, we have made the interval that replicates the data with event=1 smaller to reduce the possibly problematic initial bias of the event variable. As we can see in the graphs contained in the annexed documents of the project and not exposed here because there are too many, the frequency distributions of all the variables are kept almost perfectly for both sets. The most important distribution to maintain is the distribution of events over time. In Table 15, we can see how by maintaining the distributions; we have managed to reduce the censored data by 17% and 12%.Table 15
Joint states before and after replication.
SetInitial sizeSize after replicationInitially censoredCensored after replicationHospital8273422738 (89%)2454 (72%)TCGA6483137584 (90%)2433 (78%)


### 2.8.3. Usingmlr: Choice of Predictor Type

Having the data ready to use a prediction model, we will do an exploration to find out which type of predictor is the most appropriate. We will explore the functioning of survival-type predictors (those used in a standard way in this type of study) and predictors of probability classification. The latter, for each level of the variable to be predicted (0 or 1), will calculate its probability and return the most probable as prediction.For this exploration, we will use themlr package for R [11]. This package (acronym for machine learning in r) provides an infrastructure that, using resampling methods, evaluates the indicated algorithms making an internal adjustment to find the best hyperparameters in each case.To use this framework, we introduce the task and learner concepts. The tasks encapsulate the data and information about it necessary for the machine learning algorithm. We will create them with the functions makeSurvTask () indicating the tracking time variable and the event and makeClassifTask () indicating the variable event-to and the level that defines the survival. The learners contain the properties of the methods, we create them with the makeLearner () function, and we will indicate the algorithm and type of prediction in each case. We will also define the characteristics of the resampling strategy with the makeResampleDesc () function. In our case, we have chosen cross-validation withk=5. Finally, with the function resample (learner, task, and resampling) indicating the parameters created previously, we will obtain the mean validation measures of the validation set in the iterations of the resampling algorithm. For both sets, we will test their available algorithms in each case.


### 2.8.4. Survival Predictors

We evaluate it with the measure C-index 2.2.3. As we have seen in the explanation of this metric, a value less than 0.7 defines the model as very weak and inconsistent. None of the algorithms give good results, and the ones that are somewhat better have a high execution time. The TCGA set performs better on this type of predictor than the Hospital set. We can see the results in Table16.Table 16
Survival classifier results usingmlr Hospital and TCGA.
AlgorithmC-indexExecution timeHospitalCV CoxBoost0.588.6 minCoxBoost0.581.8 minCoxPH0.571 secCV Glmnet0.56 secsTCGACV CoxBoost0.77.2 minCoxBoost0.6926 secsCoxPH0.680.2 secsCV Glmnet0.624 secs


### 2.8.5. Predictor Probability Classification

We evaluate them with measures ACC and MMCE 3.2.1. In these predictors, we also agree on the best performance over the TCGA set, although for both sets the results are notably better than those of the survival predictors, and they present more stable execution times between the different algorithms. We can see the results in Table17. We highlight the good performance of the Bart machine algorithm (Bayesian additive regression trees) over the rest, so we will focus on exploring the algorithms derived from decision trees (random forest and gradient boosting).Table 17
Classifying results classification usingmlr Hospital and TCGA.
AlgorithmACCMMCEExecution timeHospitalBart machine0.880.121.3 minsAdaBoost machine0.830.170.32 secsBinomial0.850.150.2 secsCGTABart machine0.990.162 secsAdaBoost machine0.890.110.3 secsBinomial0.820.140.7 secs


### 2.8.6. Usingh2o

Exploratory analysis of classification models: once we know from the previous step that we are going to use predictors of the probabilistic classification type, we will use theh2o library in R [12]. This open platform offers parallel implementations of computational learning algorithms. We will use it to automate the training process of the algorithms (deep learning, random forest, gradient boosting machine, and extreme gradient boosting machine). In the previous section, we have seen the good performance of the algorithms derived from decision trees, but we will also check the behavior of the well-known deep learning algorithm.As in the analysis in the previous section, we will also evaluate the mean measures of the validation set in a cross-validationk=5. These measures will be calculated from the difference between the predictions. On returned (0 or 1) with the actual event value. Once we have validated a model, as this is a probabilistic type, we will be able to access the probability that the output is 0, that is, the probability of survival. Are probabilities for the different times will define a survival curve? Given that the unbalance in the levels in the variable to be predicted is remarkable, as we have seen in Table 15 and Figure 1, we will test the models with the balanced and unbalanced event variable for both sets.Figure 1
Interface preview (∗CTS5 refers to the Hospital set).


### 2.8.7. Hormone Therapy Decision Based on Predicted Survival

Using the Shiny extension for R, we will create an interface. In this interface, it is possible to enter the clinical data of the patient available in each set in the form of the finally chosen groupings, in addition to a fixed time. Making use of the models finally chosen and validated for each set, we will predict for the data entered the probability of survival (of which event has the value 0) for each time, returning a survival curve. In the case of the Hospital group, in which we have had the hormone therapy variable with the values IA, Tamoxifen, and Tamoxifen+IA for training, we will be able to see differentiated survival curves for each of the treatments, thus being able to know which is the one that maximizes survival in each particular case. The exact survival values for the fixed time entered will also be returned.


## 2.8.1. Data Replication

Machine learning algorithms learn by understanding the relationship between the predictor variables and the variable to predict in order to create a pattern. Furthermore, whatever the size of the data, it is a small fraction of the global population, and in nature, there are always fluctuations that differ from a strict pattern. Our objective is to find the pattern of the entire population with a sample of sizeN, and the larger N, the smaller the differences with the overall population.Our two sets of 827 and 648 records are very small and insufficient to represent the global population, so it is necessary to replicate them before they can be used to train a model.


## 2.8.2. The Data Replication Algorithm Designed Consists of, for each Record

Its event and tracking time (in months) is stored. A start time and an interval are assigned according to the follow-up time: if it is greater than 10 months, the start time will be 10 months prior to that month; if not, it will be 0. The interval will be one day, each part of the difference between the end time and follow-time.(i)
From its defined start time to follow-up time and with interval 4 if it is the Hospital dataset or 3 if it is the TCGA dataset, the rest of the variables will be replicated with the unobserved event for each time(ii)
If the event has taken place (event=1), from follow-up time to the maximum time of that set and with the calculated interval, the rest of the variables are replicatedThe main idea is that a patient with timet∈0,T had not suffered the event in time ti≤t, and if he has suffered it at time t, he would also have suffered it for a time ti≥t. In the records that replicate in backward time, they only do so up to a proportional time, and those that go to the end also do so with an interval proportional to their position. In addition, we have made the interval that replicates the data with event=1 smaller to reduce the possibly problematic initial bias of the event variable. As we can see in the graphs contained in the annexed documents of the project and not exposed here because there are too many, the frequency distributions of all the variables are kept almost perfectly for both sets. The most important distribution to maintain is the distribution of events over time. In Table 15, we can see how by maintaining the distributions; we have managed to reduce the censored data by 17% and 12%.Table 15
Joint states before and after replication.
SetInitial sizeSize after replicationInitially censoredCensored after replicationHospital8273422738 (89%)2454 (72%)TCGA6483137584 (90%)2433 (78%)


## 2.8.3. Usingmlr: Choice of Predictor Type

Having the data ready to use a prediction model, we will do an exploration to find out which type of predictor is the most appropriate. We will explore the functioning of survival-type predictors (those used in a standard way in this type of study) and predictors of probability classification. The latter, for each level of the variable to be predicted (0 or 1), will calculate its probability and return the most probable as prediction.For this exploration, we will use themlr package for R [11]. This package (acronym for machine learning in r) provides an infrastructure that, using resampling methods, evaluates the indicated algorithms making an internal adjustment to find the best hyperparameters in each case.To use this framework, we introduce the task and learner concepts. The tasks encapsulate the data and information about it necessary for the machine learning algorithm. We will create them with the functions makeSurvTask () indicating the tracking time variable and the event and makeClassifTask () indicating the variable event-to and the level that defines the survival. The learners contain the properties of the methods, we create them with the makeLearner () function, and we will indicate the algorithm and type of prediction in each case. We will also define the characteristics of the resampling strategy with the makeResampleDesc () function. In our case, we have chosen cross-validation withk=5. Finally, with the function resample (learner, task, and resampling) indicating the parameters created previously, we will obtain the mean validation measures of the validation set in the iterations of the resampling algorithm. For both sets, we will test their available algorithms in each case.


## 2.8.4. Survival Predictors

We evaluate it with the measure C-index 2.2.3. As we have seen in the explanation of this metric, a value less than 0.7 defines the model as very weak and inconsistent. None of the algorithms give good results, and the ones that are somewhat better have a high execution time. The TCGA set performs better on this type of predictor than the Hospital set. We can see the results in Table16.Table 16
Survival classifier results usingmlr Hospital and TCGA.
AlgorithmC-indexExecution timeHospitalCV CoxBoost0.588.6 minCoxBoost0.581.8 minCoxPH0.571 secCV Glmnet0.56 secsTCGACV CoxBoost0.77.2 minCoxBoost0.6926 secsCoxPH0.680.2 secsCV Glmnet0.624 secs


## 2.8.5. Predictor Probability Classification

We evaluate them with measures ACC and MMCE 3.2.1. In these predictors, we also agree on the best performance over the TCGA set, although for both sets the results are notably better than those of the survival predictors, and they present more stable execution times between the different algorithms. We can see the results in Table17. We highlight the good performance of the Bart machine algorithm (Bayesian additive regression trees) over the rest, so we will focus on exploring the algorithms derived from decision trees (random forest and gradient boosting).Table 17
Classifying results classification usingmlr Hospital and TCGA.
AlgorithmACCMMCEExecution timeHospitalBart machine0.880.121.3 minsAdaBoost machine0.830.170.32 secsBinomial0.850.150.2 secsCGTABart machine0.990.162 secsAdaBoost machine0.890.110.3 secsBinomial0.820.140.7 secs


## 2.8.6. Usingh2o

Exploratory analysis of classification models: once we know from the previous step that we are going to use predictors of the probabilistic classification type, we will use theh2o library in R [12]. This open platform offers parallel implementations of computational learning algorithms. We will use it to automate the training process of the algorithms (deep learning, random forest, gradient boosting machine, and extreme gradient boosting machine). In the previous section, we have seen the good performance of the algorithms derived from decision trees, but we will also check the behavior of the well-known deep learning algorithm.As in the analysis in the previous section, we will also evaluate the mean measures of the validation set in a cross-validationk=5. These measures will be calculated from the difference between the predictions. On returned (0 or 1) with the actual event value. Once we have validated a model, as this is a probabilistic type, we will be able to access the probability that the output is 0, that is, the probability of survival. Are probabilities for the different times will define a survival curve? Given that the unbalance in the levels in the variable to be predicted is remarkable, as we have seen in Table 15 and Figure 1, we will test the models with the balanced and unbalanced event variable for both sets.Figure 1
Interface preview (∗CTS5 refers to the Hospital set).


## 2.8.7. Hormone Therapy Decision Based on Predicted Survival

Using the Shiny extension for R, we will create an interface. In this interface, it is possible to enter the clinical data of the patient available in each set in the form of the finally chosen groupings, in addition to a fixed time. Making use of the models finally chosen and validated for each set, we will predict for the data entered the probability of survival (of which event has the value 0) for each time, returning a survival curve. In the case of the Hospital group, in which we have had the hormone therapy variable with the values IA, Tamoxifen, and Tamoxifen+IA for training, we will be able to see differentiated survival curves for each of the treatments, thus being able to know which is the one that maximizes survival in each particular case. The exact survival values for the fixed time entered will also be returned.


## 3. Results

Tables18–21 show result details as follows.Table 18
Results with standard deviation of predictor classification usingh2o in Hospital.
AlgorithmAUCACCAverage ACC per classMSEAverage MSE per classHospital with standard variables and without replicationDL0.628±0.0440.543±0.0950.658±0.0320.146±0.0250.342±0.032XGBoost0.692±0.0400.789±0.1120.650±0.0220.094±0.0130.349±0.022GBM0.658±0.0430.767±0.0540.661±0.0560.106±0.0160.339±0.056RF0.654±0.0390.763±0.1040.649±0.0270.097±0.0150.351±0.027Replicated and unbalanced HospitalDL0.974±0.0020.926±0.0060.911±0.0050.059±0.0020.089±0.005XGBoost0.964±0.0030.915±0.0060.888±0.0050.065±0.0020.112±0.005GBM0.963±0.0030.915±0.0050.882±0.0050.066±0.0020.118±0.005RF0.961±0.0030.916±0.0050.881±0.0050.069±0.0020.119±0.005Replicated and balanced HospitalDL0.974±0.0030.931±0.0050.917±0.0050.010±0.0030.082±0.010XGBoost0.966±0.0050.925±0.0050.898±0.0100.061±0.0050.102±0.010GBM0.965±0.0060.921±0.0110.889±0.0050.010±0.0060.111±0.010RF0.965±0.0040.922±0.0070.902±0.0080.067±0.0060.098±0.008Table 19
Higher precision model for Hospital set: deep learning with balanced data, hyperparameters.Learningrate=0.005, 2611 epochs.
CapActivation functionUnitsDropout indexEntry——15%Hidden 1Rectifier dropout50050%DepartureSoftmax2—Table 20
Results with standard deviation of predictor classification using h2o in TCGA.
AlgorithmAUCACCAverage ACC per classMSEAverage MSE per classStandard variables and without replicationDL0.591±0.0190.706±0.0760.639±0.0240.147±0.0320.361±0.024XGBoost0.631±0.0290.695±0.1010.634±0.0380.091±0.0120.366±0.037GBM0.647±0.0460.826±0.0380.639±0.0350.109±0.0170.361±0.035RF0.642±0.0460.806±0.0810.629±0.0360.090±0.0140.371±0.036Replicated and unbalanced TCGADL0.961±0.0090.925±0.0040.883±0.0100.064±0.0050.117±0.010XGBoost0.962±0.0050.929±0.0040.897±0.0090.055±0.0030.102±0.009GBM0.961±0.0050.929±0.0060.892±0.0120.056±0.0020.108±0.012RF0.959±0.0050.926±0.0040.882±0.0030.061±0.0020.118±0.003GLM0.933±0.0070.890±0.0180.859±0.0050.109±0.0060.143±0.013Replicated and balanced TCGADL0.961±0.0090.925±0.0040.882±0.0100.064±0.0050.117±0.010XGBoost0.961±0.0050.929±0.0040.897±0.0090.056±0.0030.108±0.012GBM0.962±0.0050.929±0.0060.892±0.0120.056±0.0020.108±0.012RF0.959±0.0050.926±0.0040.882±0.0030.061±0.0020.118±0.003GLM0.933±0.0070.890±0.0100.859±0.0050.019±0.0060.143±0.013Table 21
Higher precision model for TCGA set: extreme gradient boosting with unbalanced data, hyperparameters. 160 epochs.
Number of trees153Max deep15Learning rate5Hospital set. Mean results of the validation set with classification predictors.TCGA set.


### 3.1. Survival Curves

In the following figure, the survival curve of the unreplicated dataset is presented in the upper part. At the bottom left is the replicated set and to the right the predicted events from the replicated set and the predictor model chosen for each set.


## 3.1. Survival Curves

In the following figure, the survival curve of the unreplicated dataset is presented in the upper part. At the bottom left is the replicated set and to the right the predicted events from the replicated set and the predictor model chosen for each set.


## 4. Discussion

Our first objective was to analyze the usefulness and performance of hormone therapy and chemotherapy as treatments in our patients with adjuvant therapy and positive hormone receptors (Figure2). We have seen that hormonal therapy (especially that containing aromatase inhibitors) is well accepted and can significantly improve survival. On the other hand (Figure 3), chemotherapy, far from being effective and reducing the risk of relapse into the disease, increases it in those patients who are exposed to this treatment. Furthermore, the risk of relapse has been greater the severity of the patient.Figure 2
TCGA joint survival curves for the entire population.Figure 3
Hospital whole population survival curves.The second objective was to discover whether, for the numerical variables of our sets, the stratifications created by unsupervised machine learning that adapt to the data better explain the risk of death and recurrence than those used in a standard way. Walk in clinical practice. Having analyzed the best clustering option for each case, and analyzed these with the semiparametric Cox and nonparametric Kaplan-Meier statistical methods, we have obtained the expected results. In the case of the TCGA set with only two numerical variables, both have given their greatest significance in the stratifications defined by theK-means algorithm. In the case of the Hospital group, the most significant stratifications are divided between those used in the paper and those obtained by the clusters. For both sets, it is true that the standard stratifications in no case are the ones that best explain the risk. Once the sets with the chosen variables were defined, we wanted to find an accurate survival predictor using machine learning algorithms and check its improvement with respect to traditionally used statistical methods. We had estimated that we would obtain better results with computational learning methods than with statistical methods. We had also estimated that our data processing would improve with respect to the results normally obtained in these types of problems. In the exploratory analysis carried out with mlr, we have seen that, for the statistical methods, the maximum C-index reached is 0.58 in the Hospital set and 0.7 in the TCGA set; however, the computational learning approaches find their minimum value at a precision of 0.83 in the Hospital set and 0.82 in the TCGA set. Regarding the statistical predictors found in the literature, we can see in some examples that our results are not far from the real paradigm in cases of breast cancer obtained a maximum C-index of 0.629 in predicting the risk of recurrence. Also, with a statistical method, obtain a maximum AUC of 0.740, which obtain maximum AUCs of 0.791 and 0.714, respectively. Regarding the results with computational learning approximations in breast cancer, our validation results for the Hospital set find a maximum AUC of 0.974 (with a 0.003 standard error) with DL for the set Hospital and 0.962 (with a standard error of 0.005) with XGBoost for the TCGA set. Regarding the examples found in the literature of the last years with this approximation, we found a maximum AUC of 0.86 with ML-RO predictors, 0.930 with RF or 0.936 with DL and RF in a study using more than 200,000 cases and claimed to be the best outcome to date in 2005 [13].Not only can we affirm that, indeed, computational learning approaches significantly exceed the precision that can be obtained with statistical approximations in risk prediction in breast cancer patients; if not that, in addition, our results obtained from replicated data with stratifications adjusted with machine learning seem to surpass those studies in which this step is not performed.


## 5. Conclusion

Within our own results, we can see how, in both sets, the precision results obtained from the same original set, having replicated and chosen the stratifications, clearly differ from those obtained in the est’ version walk and without replicating. The precision in automatic learning algorithms increases between 20% and 30% thanks to the treatment carried out. In the Hospital set, the algorithm that works best is DL, probably due to having more data and being able to take advantage of its complexity (we check it in the set without replicating, where DL has the worst results among the algorithms analyzed). In the TCGA set, with less data and slightly lower results, the best performance is obtained with the XGBoost algorithm with little difference with respect to DL.It is also noteworthy that the precision values per class are lower than the global ones due to the large difference in frequency in the levels of the variable to be predicted. Due to this difference, we have performed the same analysis balancing the data. In the Hospital group, we can see an improvement in the precision values, although their standard error ranges are generally the worst. In the TCGA set, the differences caused by the balancing of data are almost imperceptible. Regarding the computation, we have not found any impediment thanks to the stoppage offered byh2o. If we did not have it, it is likely that we would not have reached such precise results, or not with the same effort.



---

*Source: 9338091-2021-11-20.xml*