Machine learning and cancer survival: analysis of the Registro Hospitalar de Câncer do Estado de São Paulo Authors: Fernando Henrique de Albuquerque Maia, Lucas Buk Cardoso, Simone Aldrey Angelo, Yasmin Pacheco Gil Bonilha, Adeylson Guimarães Ribeiro, Maria Paula Curado, Gisele Aparecida Fernandes, Alexandre Dias Porto Chiavegatto, Vanderlei Cunha Parro, Tatiana Natasha Toporcov, Fernando Henrique de Albuquerque Maia, Lucas Buk Cardoso, Simone Aldrey Angelo, Yasmin Pacheco Gil Bonilha, Adeylson Guimarães Ribeiro, Maria Paula Curado, Gisele Aparecida Fernandes, Alexandre Dias Porto Chiavegatto, Vanderlei Cunha Parro, Tatiana Natasha Toporcov Published: 2026 ABSTRACT ABSTRACTOBJECTIVE To compare the performance of different Survival Machine Learning (SML) algorithms in predicting the survival of cancer patients.METHODS Data from the Registro Hospitalar de Câncer do Estado de São Paulo (São Paulo State Cancer Registry Hospital) were used, covering the five most incident types of cancer (breast, prostate, lung, colorectal and cervix). Six algorithms were evaluated: Gradient Boosting Survival (GBS), Random Survival Forest (RSF), Support Vector Machine Survival (SVM-Survival), XGBoost Cox, XGBoost Accelerated Failure Time (AFT), and LightGBM. Performance was measured by the Concordance Index (C-Index), C-Index IPCW and Integrated Brier Score (IBS) metrics.RESULTS The XGBoost AFT model showed the best C-Index results for breast (0.7845), lung (0.7368), colorectal (0.7618), and cervix (0.7726), while GBS was superior for prostate (0.7574). Clinical staging was consistently the most important variable, according to the explainability analysis.CONCLUSION The SML algorithms showed good predictive performance, regardless of cancer type, sample size and censoring proportion. These models show potential for subsidizing cancer planning and supporting strategic decisions in the organization of cancer care networks. INTRODUCTION The incidence of cancer has risen sharply in recent years due to an ageing population and changes in lifestyle habits, with an estimated 20 million new cases and 9.7 million deaths per year 1 . It is a major public health problem, with an impact on health systems around the world. Survival analysis is a type of analysis in which the dependent variable of interest is the time until a certain event occurs 2 . In cancer, these studies aim to analyze the time between diagnosis and/or admission to a specialized service to treat the disease and the patient’s death 3 . An important aspect of this type of analysis is the inclusion of the observation time of censored individuals. Censoring occurs when a patient is lost to follow-up or when the study ends and they continue without having presented the outcome of interest. In contrast, analyses of dichotomous outcomes, such as five-year survival, need to use only those individuals for whom there is certainty about survival or death during the follow-up period, and it is necessary to exclude censored individuals from the analysis. Survival analysis models based on traditional statistics depend on assumptions about the distribution of the data. The Cox proportional hazards model (Cox-PH) is the most widely used and is a semi-parametric model that assumes the proportionality of risks for different individuals is constant over time 3 . As such, its use requires tests to confirm that the assumptions are met, requiring adaptations and adjustments when this is not the case 2 . This model is often used to estimate the effect of explanatory variables on the risk of an event over time but can be adapted for individual risk prediction using estimators such as Breslow. The use of Survival Machine Learning (SML) algorithms for survival analysis has been growing in recent years 4,5 . Their main advantage is the ability to analyze large data sets with variables of different formats, without the need to meet certain assumptions. This is especially useful in the case of attributes with non-linear associations with the variable of interest. In Brazil, some studies have looked at cancer mortality and survival 6,7 , using data from the Registro Hospitalar de Câncer do Estado de São Paulo (RHC/SP – São Paulo State Cancer Registry Hospital) of the Fundação Oncocentro do Estado de São Paulo (FOSP – São Paulo State Oncocentro Foundation). However, these studies did not consider survival time as the dependent variable of interest, but rather the occurrence or non-occurrence of the event (death) after certain time intervals. Thus, in these analyses, it was necessary to exclude individuals due to loss to follow-up. In a previous study, SML models were compared with machine learning models for dichotomous survival outcomes at one, three and five years in patients with colorectal cancer, showing that the dichotomous models underestimated the survival of these patients 8 . This article included patients with the five most frequent types of cancer in the state of São Paulo, which show significant differences in their incidence and in the proportion of censored cases. The main SML models were tested to identify the algorithms with the best prediction performance and possible differences in performance related to sample size and the proportion of censored cases. METHODS The RHC/SP, managed by FOSP, gathers socioeconomic and clinical information on patients diagnosed with cancer since 2000, provided by 81 institutions in the state of São Paulo. This database, with anonymized information, is public and can be consulted by completing a registration form on the institution’s website 9 . For this study, cases of the five most common types of cancer in the state of São Paulo were selected: breast, prostate, lung, colorectal and cervix. Before carrying out the study, the authors identified the variables that would be included in the model and the inclusion and exclusion criteria, considering the characteristics of the tumors and the available data set. The decision was made to exclude variables that showed high collinearity with the chosen variables, a low proportion of completeness or that were related to the type of treatment the individual had undergone. The intention was to work with data that is available before treatment begins, so that these models can be used in later studies to build scenarios and/or optimize the organization of the health services network. The data sets for the five types of cancer under study were prepared in two stages: general selections and column adjustments – applied to all the topographies analyzed – and specific selections, made according to the particularities of each type. For all types of cancer, patients were excluded if they were under 20 years of age, did not live in the state of São Paulo, had an undefined clinical stage or had not been diagnosed, had carcinoma in situ, had no microscopic confirmation of the diagnosis, had uncertain morphology, or had undergone a bone marrow transplant. In the specific selections, additional criteria were applied for each type of cancer. Patients with lung cancer who had received hormone therapy were excluded, since this treatment is generally intended for patients with other types of tumors with lung metastases. In the case of colorectal cancer, only patients with adenocarcinoma morphology (code 81403) were considered, since the other morphologies are rarer and show different behavior. For breast cancer, only women were included, given that this type of cancer in men is rare and behaves very differently. The set of variables analyzed included individual patient information, such as age (IDADE), sex (SEXO), and schooling (ESCOLARI); variables related to place of residence, such as the city’s IBGE code (IBGE) and Regional Health Department (DRS); and variables relating to the care institution, including institution code (INSTITU), category of care (CATEATEND), IBGE code of the institution’s city (IBGEATEN), DRS of the institution (DRS_INST), and category of qualification in high complexity oncology (HABILIT2). Clinical variables were also considered, such as diagnosis prior to admission (DIAGPREV), topography (TOPO), morphology (MORFO), clinical staging (EC), and year of diagnosis (ANODIAG). Finally, the categorized time between the first consultation and the start of treatment (TRATCONS_CAT) and between diagnosis and the start of treatment (DIAGTRAT_CAT) were evaluated. The gender variable was only used for lung and colorectal cancer, the topography variable was not considered for prostate, and the morphology variable was not considered for colorectal. The data was divided into two parts, with 80% of the patients being used to train the survival algorithms and the other 20% to validate these models. The outcome was the time between diagnosis and death from all causes, including censored patients. Six machine learning models were used for survival analysis: Gradient Boosting Survival (GBS), Random Survival Forest (RSF), Survival Support Vector Machine (SSVM), XGBoost Cox (XGB-Cox), XGBoost Accelerated Failure Time (XGB-AFT), and LightGBM (LGBM). Each adopts a different strategy for modeling the time until an event occurs and was chosen for their ability to deal with censorship in the data, capture non-linear patterns and provide more flexible predictions compared to traditional statistical approaches. The methodological aspects relating to the treatment of the database, as well as the specificities of each type of SML model, are described in more depth in another paper 8 . Three metrics were used to evaluate the survival models: Concordance Index (C-Index), Inverse Probability of Censoring Weighted Concordance Index (C-Index IPCW), and Integrated Brier Score (IBS). The C-Index is a metric used to measure the discriminatory capacity of the model, i.e. its ability to correctly order the survival times of individuals 10 . Values close to 1 indicate perfect agreement, while a value of 0.5 suggests performance equivalent to chance. The C-Index IPCW is a variation of the C-Index that corrects for biases introduced by non-informative or covariate-dependent censoring 11 . Finally, the IBS measures the accuracy of predictions of survival probability over time and is calculated from the survival curves estimated by the models. Lower values indicate better performance, with 0 being a perfect prediction 12 . As IBS depends on the survival curves, it was only calculated for the models that had adequate survival curves and were consistent with the empirical observations. The hyperparameters of the machine learning models were selected using Optuna 13 , using three different samplers. RandomSampler combines the parameters randomly; TPESampler 14 optimizes the choice using probabilistic models; and CmaEsSampler 15 employs an evolutionary strategy that adjusts a Gaussian distribution over the space of hyperparameters. Each sampler was evaluated with 150 different combinations, applying cross-validation in 10 folds for each set of parameters. For each type of cancer, the model with the best performance among the three samplers was selected. The SHapley Additive exPlanations (SHAP) and the Permutation Importance (PI) 17 were used to assess the impact of the different variables on the predictions of the survival models. SHAP estimates the average contribution of each variable to the predictions, considering all possible combinations of values, while PI evaluates the loss of model performance when the values of a variable are randomly shuffled. Ethical Aspects This study was carried out using a public database, anonymized and without sensitive variables that could identify individuals, preserving confidentiality. As such, it was not submitted to a Research Ethics Committee, in accordance with Resolution No. 510/2016 of the National Health Council. RESULTS The database was obtained from the RHC/SP in September 2024 with data on 1,223,973 individuals. After general and specific selections by type of cancer, 141,726 patients with breast cancer, 111,406 with prostate cancer, 45,719 with lung cancer, 44,856 with colorectal cancer, and 27,850 with cervical cancer were included, as described in Chart 1. Chart 1Adjustments and selections made to the RHC/SP datasets. Total number of patients in RHC/SPGeneral exclusionsSpecific selectionsTotal patients includedBreast cancer (C50)170,413 Age < 20 yearsResiding in other statesClinical staging undefined or not performedNo microscopic confirmation of diagnosisUncertain morphologyCarcinoma in situ Bone marrow transplant performed Female141,726Prostate cancer (C61)128,575(No additional specific selection)111,406Lung cancer (C34)57,620No treatment with hormone therapy45,719Colorectal cancer (C18, C19, C20)90,625Adenocarcinoma (morphology = 81403)44,856Cervical cancer (C53)56,912(No additional specific selection)27,850RHC/SP: Hospital Cancer Registry of the state of São Paulo. Chart 1Adjustments and selections made to the RHC/SP datasets. Total number of patients in RHC/SPGeneral exclusionsSpecific selectionsTotal patients includedBreast cancer (C50)170,413 Age < 20 yearsResiding in other statesClinical staging undefined or not performedNo microscopic confirmation of diagnosisUncertain morphologyCarcinoma in situ Bone marrow transplant performed Female141,726Prostate cancer (C61)128,575(No additional specific selection)111,406Lung cancer (C34)57,620No treatment with hormone therapy45,719Colorectal cancer (C18, C19, C20)90,625Adenocarcinoma (morphology = 81403)44,856Cervical cancer (C53)56,912(No additional specific selection)27,850RHC/SP: Hospital Cancer Registry of the state of São Paulo. Adjustments and selections made to the RHC/SP datasets. Age < 20 years Age < 20 years Residing in other states Residing in other states Clinical staging undefined or not performed Clinical staging undefined or not performed No microscopic confirmation of diagnosis No microscopic confirmation of diagnosis Uncertain morphology Uncertain morphology Carcinoma in situ Carcinoma in situ Bone marrow transplant performed Bone marrow transplant performed RHC/SP: Hospital Cancer Registry of the state of São Paulo. The profile of the patients included in the study is shown in Table 1. The number of patients included for each type of cancer ranged from 27,850 cervical cases to 141,726 breast cases, with 44,856 colorectal, 45,719 lung, and 111,406 prostate cases. In lung cancer and colorectal cancer, there was a predominance of male patients, corresponding to 60.2% and 52.0% of cases, respectively. Table 1Profile of patients included in the study. Breast n (%)Prostate n (%)Lungs n (%)Colorectal n (%)Cervix n (%)Schooling Illiterate4,997 (3.53)5,257 (4.72)2,418 (5.29)1,670 (3.72)2,066 (7.42)Incomplete primary education33,601 (23.71)34,875 (31.30)13,717 (30.00)11,549 (25.75)8,167 (29.33)Complete primary education22,536 (15.90)18,557 (16.66)8,967 (19.61)8,198 (18.28)4,527 (16.26)High school25,771 (18.18)13,009 (11.68)5,387 (11.78)6,302 (14.05)4,022 (14.44)Higher education15,651 (11.04)7,986 (7.17)3,022 (6.61)3,431 (7.65)1,197 (4.30)No information39,170 (27.64)31,722 (28.47)12,208 (26.70)13,706 (30.56)7,871 (28.26)Age - Average (Median)56.46 (56)67.58 (68)64.01 (64)62.39 (63)51.53 (51)Sex Male0 (0)111,406 (100)27,530 (60.21)23,312 (51.97)0 (0)Female141,726 (100)0 (0)18,189 (39.78)21,544 (48.03)27,850 (100)Category of service Insurance16,487 (11.63)10,621 (9.53)3,544 (7.75)3,991 (8.90)1,064 (3.82)SUS82,721 (58.37)68,698 (61.66)25,477 (55.72)28,149 (62.75)16,426 (58.98)Private906 (0.64)1,691 (1.52)341 (0.74)299 (0.67)74 (0.27)No information41,612 (29.36)30,396 (27.28)16,357 (35.77)12,417 (27.68)10,286 (36.93)Previous diagnosis No previous diagnosis69,411 (48.98)36,225 (32.52)29,816 (65.22)18,255 (40.70)11,761 (42.23)With previous diagnosis72,315 (51.02)75,181 (67.48)15,903 (34.78)26,601 (59.30)16,089 (57.77)Topography C500: 4,512 (3.18)C501: 6,651 (4.69)C502: 9,188 (6.48)C503: 5,195 (3.67)C504: 34,244 (24.16)C505: 6,339 (4.47)C506: 1,300 (0.92)C508: 21,803 (15.38)C509: 52,494 (37.04) C619: 111,406 (100) C340: 2,499 (5.47)C341: 12,982 (28.40)C342: 1,340 (2.93)C343: 6,736 (14.73)C348: 1,679 (3.67) C349: 20,483 (44.80) C180: 1,371 (3.06)C181: 81 (0.18)C182: 3,547 (7.91)C183: 379 (0.84)C184: 1,616 (3.60)C185: 327 (0.73)C186: 1,996 (4.45)C187: 6,638 (14.80) C188: 297 (0.66) C189: 6,955 (15.51) C199: 2,791 (6.22) C209: 18,858 (42.04) C530: 759 (2.73)C531: 1,243 (4.46)C538: 443 (1.59)C539: 25,405 (91.22) Clinical staging I33,780 (23.83)9,133 (8.20)4,936 (10.80)5,378 (11.99)8,346 (29.97)II54,970 (38.79)65,986 (59.23)2,937 (6.42)12,400 (27.64)6,544 (23.50)III38,224 (26.97)18,659 (16.75)12,037 (26.33)14,393 (32.09)8,722 (31.32)IV14,752 (10.41)17,628 (15.82)25,809 (56.45)12,685 (28.28)4,238 (15.22)Categorized time between first consultation and start of treatment Up to 60 days84,201 (59.41)51,357 (46.10)25,728 (56.27)31,905 (71.13)15,504 (55.67)Between 61 and 90 days23,604 (16.65)13,299 (11.94)5,056 (11.06)5,030 (11.21)4,709 (16.91)More than 91 days31,390 (22.15)39,839 (35.76)7,008 (15.33)5,743 (12.80)6,245 (22.42)Not treated2,531 (1.79)6,911 (6.20)7,927 (17.34)2,178 (4.86)1,392 (5.00)Categorized time between diagnosis and start of treatment Up to 60 days69,639 (49.14)31,301 (28.10)26,809 (58.64)25,554 (56.97)11,608 (41.68)Between 61 and 90 days26,803 (18.91)14,725 (13.22)5,035 (11.01)7,019 (15.65)5,211 (18.71)More than 91 days42,753 (30.17)58,469 (52.48)5,948 (13.01)10,105 (22.53)9,639 (34.61)Not treated2,531 (1.79)6,911 (6.20)7,927 (17.34)2,178 (4.86)1,392 (5.00)Death from all causes No95,069 (67.08)75,027 (67.35)6,808 (14.89)22,979 (51.23)15,333 (55.06)Yes46,657 (32.92)36,379 (32.65)38,911 (85.11)21,877 (48.77)12,517 (44.94)Model split Training113,380 (80.00)89,124 (80.00)36,575 (80.00)35,884 (80.00)22,280 (80.00)Test28,346 (20.00)22,282 (20.00)9,144 (20.00)8,972 (20.00)5,570 (20.00)Total141,726 (100)111,406 (100)45,719 (100)44,856 (100)27,850 (100) Table 1Profile of patients included in the study. Breast n (%)Prostate n (%)Lungs n (%)Colorectal n (%)Cervix n (%)Schooling Illiterate4,997 (3.53)5,257 (4.72)2,418 (5.29)1,670 (3.72)2,066 (7.42)Incomplete primary education33,601 (23.71)34,875 (31.30)13,717 (30.00)11,549 (25.75)8,167 (29.33)Complete primary education22,536 (15.90)18,557 (16.66)8,967 (19.61)8,198 (18.28)4,527 (16.26)High school25,771 (18.18)13,009 (11.68)5,387 (11.78)6,302 (14.05)4,022 (14.44)Higher education15,651 (11.04)7,986 (7.17)3,022 (6.61)3,431 (7.65)1,197 (4.30)No information39,170 (27.64)31,722 (28.47)12,208 (26.70)13,706 (30.56)7,871 (28.26)Age - Average (Median)56.46 (56)67.58 (68)64.01 (64)62.39 (63)51.53 (51)Sex Male0 (0)111,406 (100)27,530 (60.21)23,312 (51.97)0 (0)Female141,726 (100)0 (0)18,189 (39.78)21,544 (48.03)27,850 (100)Category of service Insurance16,487 (11.63)10,621 (9.53)3,544 (7.75)3,991 (8.90)1,064 (3.82)SUS82,721 (58.37)68,698 (61.66)25,477 (55.72)28,149 (62.75)16,426 (58.98)Private906 (0.64)1,691 (1.52)341 (0.74)299 (0.67)74 (0.27)No information41,612 (29.36)30,396 (27.28)16,357 (35.77)12,417 (27.68)10,286 (36.93)Previous diagnosis No previous diagnosis69,411 (48.98)36,225 (32.52)29,816 (65.22)18,255 (40.70)11,761 (42.23)With previous diagnosis72,315 (51.02)75,181 (67.48)15,903 (34.78)26,601 (59.30)16,089 (57.77)Topography C500: 4,512 (3.18)C501: 6,651 (4.69)C502: 9,188 (6.48)C503: 5,195 (3.67)C504: 34,244 (24.16)C505: 6,339 (4.47)C506: 1,300 (0.92)C508: 21,803 (15.38)C509: 52,494 (37.04) C619: 111,406 (100) C340: 2,499 (5.47)C341: 12,982 (28.40)C342: 1,340 (2.93)C343: 6,736 (14.73)C348: 1,679 (3.67) C349: 20,483 (44.80) C180: 1,371 (3.06)C181: 81 (0.18)C182: 3,547 (7.91)C183: 379 (0.84)C184: 1,616 (3.60)C185: 327 (0.73)C186: 1,996 (4.45)C187: 6,638 (14.80) C188: 297 (0.66) C189: 6,955 (15.51) C199: 2,791 (6.22) C209: 18,858 (42.04) C530: 759 (2.73)C531: 1,243 (4.46)C538: 443 (1.59)C539: 25,405 (91.22) Clinical staging I33,780 (23.83)9,133 (8.20)4,936 (10.80)5,378 (11.99)8,346 (29.97)II54,970 (38.79)65,986 (59.23)2,937 (6.42)12,400 (27.64)6,544 (23.50)III38,224 (26.97)18,659 (16.75)12,037 (26.33)14,393 (32.09)8,722 (31.32)IV14,752 (10.41)17,628 (15.82)25,809 (56.45)12,685 (28.28)4,238 (15.22)Categorized time between first consultation and start of treatment Up to 60 days84,201 (59.41)51,357 (46.10)25,728 (56.27)31,905 (71.13)15,504 (55.67)Between 61 and 90 days23,604 (16.65)13,299 (11.94)5,056 (11.06)5,030 (11.21)4,709 (16.91)More than 91 days31,390 (22.15)39,839 (35.76)7,008 (15.33)5,743 (12.80)6,245 (22.42)Not treated2,531 (1.79)6,911 (6.20)7,927 (17.34)2,178 (4.86)1,392 (5.00)Categorized time between diagnosis and start of treatment Up to 60 days69,639 (49.14)31,301 (28.10)26,809 (58.64)25,554 (56.97)11,608 (41.68)Between 61 and 90 days26,803 (18.91)14,725 (13.22)5,035 (11.01)7,019 (15.65)5,211 (18.71)More than 91 days42,753 (30.17)58,469 (52.48)5,948 (13.01)10,105 (22.53)9,639 (34.61)Not treated2,531 (1.79)6,911 (6.20)7,927 (17.34)2,178 (4.86)1,392 (5.00)Death from all causes No95,069 (67.08)75,027 (67.35)6,808 (14.89)22,979 (51.23)15,333 (55.06)Yes46,657 (32.92)36,379 (32.65)38,911 (85.11)21,877 (48.77)12,517 (44.94)Model split Training113,380 (80.00)89,124 (80.00)36,575 (80.00)35,884 (80.00)22,280 (80.00)Test28,346 (20.00)22,282 (20.00)9,144 (20.00)8,972 (20.00)5,570 (20.00)Total141,726 (100)111,406 (100)45,719 (100)44,856 (100)27,850 (100) Profile of patients included in the study. C500: 4,512 (3.18) C500: 4,512 (3.18) C501: 6,651 (4.69) C501: 6,651 (4.69) C502: 9,188 (6.48) C502: 9,188 (6.48) C503: 5,195 (3.67) C503: 5,195 (3.67) C504: 34,244 (24.16) C504: 34,244 (24.16) C505: 6,339 (4.47) C505: 6,339 (4.47) C506: 1,300 (0.92) C506: 1,300 (0.92) C508: 21,803 (15.38) C508: 21,803 (15.38) C509: 52,494 (37.04) C509: 52,494 (37.04) C619: 111,406 (100) C619: 111,406 (100) C340: 2,499 (5.47) C340: 2,499 (5.47) C341: 12,982 (28.40) C341: 12,982 (28.40) C342: 1,340 (2.93) C342: 1,340 (2.93) C343: 6,736 (14.73) C343: 6,736 (14.73) C348: 1,679 (3.67) C349: 20,483 (44.80) C348: 1,679 (3.67) C349: 20,483 (44.80) C180: 1,371 (3.06) C180: 1,371 (3.06) C181: 81 (0.18) C181: 81 (0.18) C182: 3,547 (7.91) C182: 3,547 (7.91) C183: 379 (0.84) C183: 379 (0.84) C184: 1,616 (3.60) C184: 1,616 (3.60) C185: 327 (0.73) C185: 327 (0.73) C186: 1,996 (4.45) C186: 1,996 (4.45) C187: 6,638 (14.80) C188: 297 (0.66) C189: 6,955 (15.51) C199: 2,791 (6.22) C209: 18,858 (42.04) C187: 6,638 (14.80) C188: 297 (0.66) C189: 6,955 (15.51) C199: 2,791 (6.22) C209: 18,858 (42.04) C530: 759 (2.73) C530: 759 (2.73) C531: 1,243 (4.46) C531: 1,243 (4.46) C538: 443 (1.59) C538: 443 (1.59) C539: 25,405 (91.22) C539: 25,405 (91.22) The proportion of deaths from all causes varied considerably between the types of cancer included. Lung cancer cases had the highest proportion of deaths (85.1%), while breast and prostate had the lowest proportion of deaths, with values close to each other (32.9% and 32.7%, respectively). Colorectal (48.8%) and cervix (44.9%) were at intermediate levels. The distribution according to topography, as well as the division between training and testing can be found in the Supplementary Material a . The Kaplan-Meier curves stratified by clinical stage can also be found in the Supplementary Material. Table 2 shows the performance of the SML models for predicting survival after optimizing the hyperparameters for the five types of cancer. In breast cancer, the XGB-AFT model showed the best performance in terms of C-Index (0.7845) and C-Index IPCW (0.7570), while GBS obtained the lowest IBS (0.1325). As for prostate cancer, GBS stood out with the best C-Index (0.7574) and C-Index IPCW (0.7332) values, as well as the lowest IBS (0.1298). In the lung cancer scenario, the XGB-AFT model obtained the highest C-Index (0.7368) and the highest IPCW C-Index (0.7325), although the lowest IBS was recorded by the GBS model (0.1165). For colorectal cancer, the XGB-AFT again showed the highest C-Index (0.7618) and C-Index IPCW (0.7532) values, while the lowest IBS was recorded by the GBS (0.1552). Finally, in the case of cervical cancer, the XGB-Cox model achieved the highest C-Index (0.7726), while the GBS obtained the highest IPCW C-Index (0.7643) and the lowest IBS (0.1473). The survival curves are presented in the Supplementary Material. Table 2Summary of the results obtained by the best models after searching for hyperparameters.ModelsBreast cancerProstate cancerLung cancerColorectal cancerCervical cancerC-IndexC-Index IPCWIBSC-IndexC-Index IPCWIBSC-IndexC-Index IPCWIBSC-IndexC-Index IPCWIBSC-IndexIPCW C-IndexIBSRSF0.77840.75250.13350.75570.73000.13030.72470.72120.11920.75470.74890.15650.76640.75830.1481GBS0.78210.7565 0.1324 0.7574 0.7332 0.1298 0.73240.7288 0.1165 0.75880.7526 0.1552 0.7722 0.7643 0.1473 SSVM0.75740.73010.14150.70940.69070.14240.66860.66690.13100.70880.70360.17740.73720.73150.1630XGB - Cox0.70210.6896-0.67470.6645-0.72120.7174-0.72400.7184-0.74520.7375-XGB - AFT 0.7845 0.7570 -0.75740.7328- 0.7368 0.7325 - 0.7618 0.7532 - 0.7726 0.7639-LGBM0.71330.7000-0.68620.6742-0.72100.7170-0.72750.7211-0.74830.7404-Note: models that achieved the best performance for each tumor type and evaluated metric are highlighted in bold.C-Index: Concordance Index; C-Index IPCW: Inverse Probability of Censoring Weighted Concordance Index; GBS: Gradient Boosting Survival; IBS: Integrated Brier Score; LGBM: LightGBM; RSF: Random Survival Forest; SSVM: Survival Support Vector Machine; XGB-Cox: XGBoost Cox; XGB-AFT: XGBoost Accelerated Failure Time. Table 2Summary of the results obtained by the best models after searching for hyperparameters.ModelsBreast cancerProstate cancerLung cancerColorectal cancerCervical cancerC-IndexC-Index IPCWIBSC-IndexC-Index IPCWIBSC-IndexC-Index IPCWIBSC-IndexC-Index IPCWIBSC-IndexIPCW C-IndexIBSRSF0.77840.75250.13350.75570.73000.13030.72470.72120.11920.75470.74890.15650.76640.75830.1481GBS0.78210.7565 0.1324 0.7574 0.7332 0.1298 0.73240.7288 0.1165 0.75880.7526 0.1552 0.7722 0.7643 0.1473 SSVM0.75740.73010.14150.70940.69070.14240.66860.66690.13100.70880.70360.17740.73720.73150.1630XGB - Cox0.70210.6896-0.67470.6645-0.72120.7174-0.72400.7184-0.74520.7375-XGB - AFT 0.7845 0.7570 -0.75740.7328- 0.7368 0.7325 - 0.7618 0.7532 - 0.7726 0.7639-LGBM0.71330.7000-0.68620.6742-0.72100.7170-0.72750.7211-0.74830.7404-Note: models that achieved the best performance for each tumor type and evaluated metric are highlighted in bold.C-Index: Concordance Index; C-Index IPCW: Inverse Probability of Censoring Weighted Concordance Index; GBS: Gradient Boosting Survival; IBS: Integrated Brier Score; LGBM: LightGBM; RSF: Random Survival Forest; SSVM: Survival Support Vector Machine; XGB-Cox: XGBoost Cox; XGB-AFT: XGBoost Accelerated Failure Time. Summary of the results obtained by the best models after searching for hyperparameters. Note: models that achieved the best performance for each tumor type and evaluated metric are highlighted in bold. C-Index: Concordance Index; C-Index IPCW: Inverse Probability of Censoring Weighted Concordance Index; GBS: Gradient Boosting Survival; IBS: Integrated Brier Score; LGBM: LightGBM; RSF: Random Survival Forest; SSVM: Survival Support Vector Machine; XGB-Cox: XGBoost Cox; XGB-AFT: XGBoost Accelerated Failure Time. Chart 2 shows the most relevant variables for predicting survival, identified using the SHAP and PI methods, for each type of cancer analyzed. The models selected were those with the best performance in Table 2 according to the IPCW C-Index: XGB-AFT for breast, lung and colorectal; GBS for prostate and cervix. The variable CE (clinical staging) was consistently classified as the most important in the breast, prostate, cervical and colorectal cancer models, by both the SHAP and PI methods, while in lung cancer it was the most important only according to the SHAP method, and in the PI method the categorized time between consultation and treatment was the most important variable. The Figure shows the distribution of SHAP values. Chart 2Importance of features according to the SHAP and Permutation Importance methods. Breast cancerProstate cancerLung cancerColorectal cancerCervical cancerXGB - AFTGBSXGB - AFTXGB - AFTGBSSHAPPISHAPPISHAPPISHAPPISHAPPI1ECECECECECTRATCONS_CATECECECEC2IDADEIDADEIDADEIDADETRATCONS_CATECIDADETRATCONS_CATDIAGTRAT_CATCATEATEND3CATEATENDCATEATENDCATEATENDCATEATENDDIAGTRAT_CATDIATRAT_CATCATEATENDIDADECATEATENDDIAGTRAT_CAT4ANODIAGANODIAGDIAGTRAT_CATDIAGTRAT_CATMORFOMORFOTRATCONS_CATINSTITUIDADEIDADE5IBGEATENIBGEATENANODIAGANODIAGTOPOINSTITUDIAGPREVCATEATENDANODIAGANODIAG6DIAGTRAT_CATINSTITUDIAGPREVINSTITUSEXOTOPOINSTITUANODIAGTRATCONS_CATINSTITU7TOPOTRATCONS_CATTRATCONS_CATTRATCONS_CATDIAGPREVDIAGPREVDIAGTRAT_CATDIAGTRAT_CATIBGEATENTRATCONS_CAT8DIAGPREVESCOLARIINSTITUIBGEATENIDADEIDADEANODIAGTOPOINSTITUIBGEATEN9ESCOLARIDIAGTRAT_CATMORFODRS_INSTCATEATENDCATEATENDTOPOIBGEATENHABILIT2ESCOLARI10TRATCONS_CATTOPOESCOLARIHABILIT2INSTITUANODIAGSEXODIAGPREVESCOLARIMORFOANODIAG: year of diagnosis; CATEATEND: category of care; DIAGPREV: diagnosis prior to admission; DIAGTRAT_CAT: categorized time between diagnosis and start of treatment; DRS: Regional Health Department; DRS_INST: Regional Health Department of the institution; EC: clinical staging; ESCOLARI: schooling; GBS: Gradient Boosting Survival; HABILIT2: high complexity oncology qualification category; IBGE: IBGE code of the city of residence; IBGEATEN: IBGE code of the city of the institution; IDADE: age; INSTITU: institution code; MORFO: tumor morphology; PI: Permutation Importance; SHAP: SHapley Additive exPlanations; TOPO: tumor topography; TRATCONS_CAT: categorized time between first consultation and start of treatment; XGB-AFT: XGBoost Accelerated Failure Time. Chart 2Importance of features according to the SHAP and Permutation Importance methods. Breast cancerProstate cancerLung cancerColorectal cancerCervical cancerXGB - AFTGBSXGB - AFTXGB - AFTGBSSHAPPISHAPPISHAPPISHAPPISHAPPI1ECECECECECTRATCONS_CATECECECEC2IDADEIDADEIDADEIDADETRATCONS_CATECIDADETRATCONS_CATDIAGTRAT_CATCATEATEND3CATEATENDCATEATENDCATEATENDCATEATENDDIAGTRAT_CATDIATRAT_CATCATEATENDIDADECATEATENDDIAGTRAT_CAT4ANODIAGANODIAGDIAGTRAT_CATDIAGTRAT_CATMORFOMORFOTRATCONS_CATINSTITUIDADEIDADE5IBGEATENIBGEATENANODIAGANODIAGTOPOINSTITUDIAGPREVCATEATENDANODIAGANODIAG6DIAGTRAT_CATINSTITUDIAGPREVINSTITUSEXOTOPOINSTITUANODIAGTRATCONS_CATINSTITU7TOPOTRATCONS_CATTRATCONS_CATTRATCONS_CATDIAGPREVDIAGPREVDIAGTRAT_CATDIAGTRAT_CATIBGEATENTRATCONS_CAT8DIAGPREVESCOLARIINSTITUIBGEATENIDADEIDADEANODIAGTOPOINSTITUIBGEATEN9ESCOLARIDIAGTRAT_CATMORFODRS_INSTCATEATENDCATEATENDTOPOIBGEATENHABILIT2ESCOLARI10TRATCONS_CATTOPOESCOLARIHABILIT2INSTITUANODIAGSEXODIAGPREVESCOLARIMORFOANODIAG: year of diagnosis; CATEATEND: category of care; DIAGPREV: diagnosis prior to admission; DIAGTRAT_CAT: categorized time between diagnosis and start of treatment; DRS: Regional Health Department; DRS_INST: Regional Health Department of the institution; EC: clinical staging; ESCOLARI: schooling; GBS: Gradient Boosting Survival; HABILIT2: high complexity oncology qualification category; IBGE: IBGE code of the city of residence; IBGEATEN: IBGE code of the city of the institution; IDADE: age; INSTITU: institution code; MORFO: tumor morphology; PI: Permutation Importance; SHAP: SHapley Additive exPlanations; TOPO: tumor topography; TRATCONS_CAT: categorized time between first consultation and start of treatment; XGB-AFT: XGBoost Accelerated Failure Time. Importance of features according to the SHAP and Permutation Importance methods. ANODIAG: year of diagnosis; CATEATEND: category of care; DIAGPREV: diagnosis prior to admission; DIAGTRAT_CAT: categorized time between diagnosis and start of treatment; DRS: Regional Health Department; DRS_INST: Regional Health Department of the institution; EC: clinical staging; ESCOLARI: schooling; GBS: Gradient Boosting Survival; HABILIT2: high complexity oncology qualification category; IBGE: IBGE code of the city of residence; IBGEATEN: IBGE code of the city of the institution; IDADE: age; INSTITU: institution code; MORFO: tumor morphology; PI: Permutation Importance; SHAP: SHapley Additive exPlanations; TOPO: tumor topography; TRATCONS_CAT: categorized time between first consultation and start of treatment; XGB-AFT: XGBoost Accelerated Failure Time. FigureSHAP values for interpretability of the best performing models, according to type of cancer.ANODIAG: year of diagnosis; CATEATEND: category of care; DIAGPREV: diagnosis prior to admission; DIAGTRAT_CAT: categorized time between diagnosis and start of treatment; DRS: Regional Health Department; DRS_INST: Regional Health Department of the institution; EC: clinical staging; ESCOLARI: schooling; GBS: Gradient Boosting Survival; HABILIT2: high complexity oncology qualification category; IBGE: IBGE code of the city of residence; IBGEATEN: IBGE code of the city of the institution; IDADE: age; INSTITU: institution code; MORFO: tumor morphology; SHAP: SHapley Additive exPlanations; TOPO: tumor topography; TRATCONS_CAT: categorized time between first consultation and start of treatment; XGB-AFT: XGBoost Accelerated Failure Time.Note: the SHAP values quantify the contribution of each variable to the individual predictions, making it possible to identify both the overall importance of the variables and their impact on the model’s prediction. The beeswarm graphs show the distribution of SHAP values, where each point represents an individual; the color indicates the value of the variable (red = highest values; blue = lowest values), and the position on the x-axis represents the impact of that variable on the prediction. (A) Breast - XGB-AFT; (B) Prostate - GBS; (C) Lung - XGB-AFT; (D) Colorectal - XGB-AFT; (E) Cervix - GBS. SHAP values for interpretability of the best performing models, according to type of cancer. DISCUSSION This study stands out by demonstrating the applicability of SML models for predicting survival in patients with five types of cancer. The models performed as assessed by the C-Index, with values between 0.6686 and 0.7845, showing the potential of SML algorithms to predict survival from data collected by cancer registries. The GBS and XGB-AFT models had the best metrics for the various types of cancer. GBS was superior in prostate cancer, while XGB-AFT was the best among the other types of tumors. RSF obtained the third best result for all topographies. It should also be noted that the best algorithms had good predictive performance, above 0.73, regardless of the proportion of censored cases in the sample and the total number of patients included. GBS showed the best performance in terms of IBS across all tumor categories.. In a previous study, our group had already identified good predictive capacity using data from the cancer registry 6 . Considering five-year survival, an accuracy of 77.9% and an AUC of 0.858 were obtained with XGBoost. However, in that study it was necessary to exclude individuals who did not have a complete follow-up period. Thus, out of a total of 31,916 eligible patients, only 23,338 (73%) could be used in the analysis. In another publication, when comparing these results with the SML algorithms, the results showed that the algorithms for dichotomous outcomes underestimated the survival of patients with colorectal cancer by up to 18% in the first year, demonstrating that the SML models are more suitable for this type of analysis. Considering the weight of the inputs in the model results, the CE variable was the most important in all the analyses, except in the PI for lung cancer, where it came second. This finding is consistent with that of other authors 18 , and demonstrates the importance of staging at diagnosis as the main prognostic factor for different types of cancer. In breast cancer, the XGB-AFT model performed best, with a C-Index of 0.7845, surpassing the 0.73 obtained in a study of 36,958 patients diagnosed in the Netherlands between 2005 and 2008 19 . In this study, the XGB outperformed the Cox-PH, RSF and SSVM models, whose C-Indexes ranged from 0.63 to 0.64. In the analysis of the importance of variables by SHAP, age and staging stood out as the main predictors, just as we found in our study. For prostate cancer, the best result was achieved with the GBS model (C-Index = 0.7574), higher than that found in a study using the Surveillance, Epidemiology, and End Results (SEER) database, which brings together data from 18 population-based cancer registries in the United States 20 . Data from patients diagnosed with prostate cancer between 2000 and 2019, with a positive lymph node and no metastases, was used, with a total of 3,280 patients. In this investigation, a C-Index value of 0.745 was obtained with the Gradient Boosting Survival Analysis (GBSA) technique and with the Extra Survival Trees (EST), higher than the other models analyzed, RSF and Cox-PH, which ranged between 0.734 and 0.743. In the case of lung cancer, the XGB-AFT also stood out (C-Index = 0.7368), surpassing the results obtained in a study using the population-based cancer registry of a state in Germany 21 . Data from patients diagnosed with lung cancer between 2016 and 2021 was used, with a total of 10,383 patients. In this literature study, the RSF model with variable imputation obtained a C-Index of 0.703, while the other approaches (Cox-PH, DeepSurv, and TabNet) performed less well (0.556 to 0.701). For colorectal cancer, XGB-AFT obtained the highest C-Index in the analysis (0.7618), although this was lower than that found in a study using a hospital database in China 22 . Data from patients diagnosed with colorectal cancer between 2012 and 2019 was used, with a total of 2,157 patients. In the aforementioned study, a C-Index value of 0.789 was obtained for DeepHit, while the other techniques analyzed (Cox-PH, RSF, GB, DeepSurv, Cox-Time, and Neural Multitask Logistic Regression) varied between 0.781 and 0.787. The most important variable in the SHAP analysis of the DeepHit model was staging. It is worth noting that a key variable in the study, the surgical resection margin, is not available in the RHC/SP. Finally, in cervical cancer, the best algorithm was XGB-AFT, which had a C-Index of 0.7726, lower than the value found in a study using the SEER database 23 . Data from patients diagnosed with cervical cancer between 2013 and 2015 was used, with a total of 3,810 patients. In this literature study, a C-Index value of 0.95 was obtained for the RSF, while the Cox-PH and Weibull obtained 0.81 and 0.80, respectively. The most important variable was T stage, followed by tumor size and staging. Variables related to treatment were used, such as chemotherapy and radiotherapy, in addition to the measurement of tumor size, which are variables we chose not to use in our study. The use of variables restricted to individual information, such as place of residence, institution of care, clinical characteristics, and time until treatment, without including type of treatment or tumor recurrence, is a strength of the study. This choice broadens the applicability of the models in real planning contexts, as this data is available early in the records. Thus, the algorithms developed can support strategic health management decisions, even in scenarios with limited clinical data. However, the absence of more specific clinical information, such as tumor markers and recurrence data, restricts its use for individual clinical prediction, placing its main contribution in supporting health management and scenario building. This study has some limitations. Firstly, it is important to note that the study used information from the RHC/SP database. This data is collected in hospitals from medical records by professionals from the institutions themselves, with heterogeneous teams. Although all the registrars receive specific training and use the SISRHC software, which has internal checks and consistency rules capable of standardizing the information, such as restrictions on the selection of morphologies compatible with each topography, inaccuracies can still occur, especially in more complex variables. One attempt to mitigate this risk was to exclude patients without staging or with undefined staging, which suggests poorer quality of the record. In addition, the database currently does not capture some factors relevant to survival, such as race/skin color, risk factors such as smoking and clinical data such as tumor markers. The latter are particularly important, as they have an impact on more precise definitions of staging and the probability of survival. Therefore, updating registration systems to include new variables could increase the predictive potential of the models. Additionally, it should be borne in mind that no direct comparison of performance was made with Cox models. The application of this type of model requires the proportionality of risks over time, which may make it unfeasible to include variables that do not meet this premise 2 . Thus, its use could restrict the set of predictor variables considered in the analysis. Another relevant limitation is that it was not possible to calculate the IBS for the XGB-AFT, XGB-COX, and LGBM models, due to the lack of survival curve estimates with adequate adherence to the observed data, even after adjustment attempts. Future research could explore variations in parameterization, pre-processing or specific methodological adaptations for these algorithms, to make it possible to obtain reliable curves and, consequently, calculate the IBS. It is also worth noting that it was not possible to use SurvSHAP 24 , a specific method for assessing the impact of different variables on survival model predictions. This was because its application requires the generation of individual explanations over multiple survival time points, making processing particularly onerous on extensive bases and in more complex models. We therefore opted to use the traditional SHAP 16 and PI 17 for the global assessment of the importance of the variables. Finally, although the models performed well on RHC/SP data, their application to records from other regions of the country has not been tested. It should be noted that one variable of great importance to the models, clinical staging, has high non-completion values in some regions of the country, which may limit its application. This lack of external validation limits the extrapolation of the results to other states, which could be the subject of future studies exploring the robustness of these models in more heterogeneous national cancer registry databases. CONCLUSIONS The SML algorithms proved to be applicable to the RHC/SP data for survival analysis. GBS, XGB-AFT, and RSF performed best, regardless of sample size or censoring proportion. The results reinforce the potential of these models to support evidence-based public policies, identifying profiles of patients or services at greater risk and contributing to better targeting of resources and organization of care networks. Supplementary material available from: https://doi.org/10.5281/zenodo.19250128 INTRODUÇÃO A incidência de câncer tem aumentado acentuadamente ao longo dos últimos anos, devido ao envelhecimento da população e às mudanças de hábitos de vida, sendo estimados 20 milhões de casos novos e 9,7 milhões de óbitos por ano 1 . É um importante problema de saúde pública, com impacto nos sistemas de saúde em todo o mundo. A análise de sobrevida é um tipo de análise em que a variável dependente de interesse é o tempo até que ocorra determinado evento 2 . Em câncer, esses estudos visam analisar o tempo entre o diagnóstico e/ou admissão em um serviço especializado no tratamento da doença e o óbito do paciente 3 . Um aspecto importante deste tipo de análise é a inclusão do tempo de observação dos indivíduos censurados. A censura ocorre quando existe perda de seguimento do paciente ou quando o estudo termina e ele segue sem ter apresentado o desfecho de interesse. Em contraposição, análises de desfechos dicotômicos, como sobrevida em cinco anos, precisam utilizar somente os indivíduos sobre os quais há certeza acerca da sobrevida ou do óbito durante o período de acompanhamento, sendo necessário excluir da análise os censurados. Os modelos de análise de sobrevida baseados em estatística tradicional dependem de premissas acerca da distribuição dos dados. O modelo de riscos proporcionais de Cox (Cox-PH) é o mais utilizado e é um modelo semiparamétrico que assume a proporcionalidade dos riscos para os diferentes indivíduos de maneira constante ao longo do tempo 3 . Desta forma, o uso dele exige a realização de testes que confirmem que as premissas são atendidas, necessitando de adaptações e ajustes quando isso não ocorre 2 . Este modelo é frequentemente utilizado para estimar o efeito de variáveis explicativas sobre o risco de um evento ao longo do tempo, mas pode ser adaptado para predição individual de risco a partir de estimadores como o de Breslow. O uso dos algoritmos de Survival Machine Learning (SML) para análise de sobrevida tem sido crescente nos últimos anos 4,5 . A sua principal vantagem consiste na capacidade de análise de amplos conjuntos de dados com variáveis de diversos formatos, sem necessidade de cumprir determinadas premissas. Isso é especialmente útil em casos de atributos com associações não lineares com a variável de interesse. No Brasil, alguns trabalhos já abordaram a mortalidade e sobrevida por câncer 6,7 , considerando os dados do Registro Hospitalar de Câncer do Estado de São Paulo (RHC/SP) da Fundação Oncocentro do Estado de São Paulo (FOSP). Entretanto, estes trabalhos não consideraram o tempo de sobrevida enquanto variável dependente de interesse, e sim a ocorrência ou não do evento (óbito) após determinados intervalos de tempo. Desta forma, nestas análises foi necessário excluir indivíduos por perda de seguimento. Em um estudo prévio, foi realizada a comparação de modelos de SML com modelos de machine learning para desfechos dicotômicos de sobrevida em um, três e cinco anos de pacientes com câncer colorretal, demonstrando que os modelos dicotômicos subestimaram a sobrevida destes pacientes 8 . Neste artigo, foram incluídos pacientes com os cinco tipos de câncer mais frequentes no estado de São Paulo, que apresentam diferenças expressivas na sua incidência e na proporção de casos censurados. Foram testados os principais modelos de SML visando identificar os algoritmos que apresentam melhor desempenho na predição e possíveis diferenças de desempenho relacionadas ao tamanho das amostras e à proporção de casos censurados. MÉTODOS O RHC/SP, gerido pela FOSP, reúne informações socioeconômicas e clínicas de pacientes diagnosticados com câncer desde o ano 2000, fornecidas por 81 instituições do estado de São Paulo. Este banco de dados, com informações anonimizadas, é público e pode ser consultado mediante o preenchimento de um cadastro no site da instituição 9 . Para este estudo, foram selecionados casos de cinco tipos de câncer mais incidentes no estado de São Paulo: mama, próstata, pulmão, colorretal e colo do útero. Previamente à realização do estudo, os autores identificaram as variáveis que seriam incluídas no modelo e os critérios de inclusão e exclusão, considerando as características dos tumores e do conjunto de dados disponível. Optou-se por excluir variáveis que apresentavam alta colinearidade com as variáveis escolhidas, baixa proporção de preenchimento ou que estavam relacionadas ao tipo de tratamento a que o indivíduo foi submetido. A intenção foi trabalhar com dados que estão disponíveis antes de iniciar o tratamento, para possibilitar o uso destes modelos em estudos posteriores com construção de cenários e/ou otimização da organização da rede de serviços de saúde. A preparação dos conjuntos de dados para os cinco tipos de câncer em estudo ocorreu em duas etapas: seleções gerais e ajustes das colunas – aplicadas a todas as topografias analisadas – e seleções específicas, realizadas de acordo com as particularidades de cada tipo. Para todos os tipos de câncer, foram excluídos pacientes com menos de 20 anos, não residentes no estado de São Paulo, com estadiamento clínico indefinido ou não realizado, com carcinoma in situ, sem confirmação microscópica do diagnóstico, com morfologia incerta, ou que tenham realizado transplante de medula óssea. Nas seleções específicas, foram aplicados critérios adicionais para cada tipo de câncer. Pacientes com câncer de pulmão que receberam hormonioterapia foram excluídos, tendo em vista que este tratamento em geral é destinado a pacientes com outros tipos de tumores com metástases pulmonares. No caso do câncer colorretal, foram considerados apenas os pacientes com morfologia de adenocarcinoma (código 81403), tendo em vista que as outras morfologias são mais raras e apresentam comportamento distinto. Para o câncer de mama, foram incluídas apenas mulheres, tendo em vista que este tipo de câncer em homens é raro e se comporta de forma muito distinta. O conjunto de variáveis analisado incluiu informações individuais do paciente, como idade (IDADE), sexo (SEXO) e escolaridade (ESCOLARI); variáveis relacionadas ao local de residência, como o código IBGE da cidade (IBGE) e o Departamento Regional de Saúde (DRS); e variáveis referentes à instituição de atendimento, incluindo código da instituição (INSTITU), categoria de atendimento (CATEATEND), código IBGE da cidade da instituição (IBGEATEN), DRS da instituição (DRS_INST) e categoria de habilitação em alta complexidade em oncologia (HABILIT2). Também foram consideradas variáveis clínicas, como diagnóstico prévio à admissão (DIAGPREV), topografia (TOPO), morfologia (MORFO), estadiamento clínico (EC) e ano de diagnóstico (ANODIAG). Por fim, avaliou-se o tempo categorizado entre a primeira consulta e o início do tratamento (TRATCONS_CAT) e entre o diagnóstico e o início do tratamento (DIAGTRAT_CAT). A variável sexo foi utilizada apenas para câncer de pulmão e colorretal, a variável topografia não foi considerada para próstata e a variável morfologia não foi considerada para colorretal. Os dados foram divididos em duas partes, com 80% dos pacientes sendo utilizados para o treinamento dos algoritmos de sobrevida e os outros 20% para validação destes modelos. Foi considerado como desfecho o tempo entre o diagnóstico e a ocorrência do óbito por todas as causas, sendo incluídos os pacientes censurados. Foram utilizados seis modelos de aprendizado de máquina voltados para a análise de sobrevida: Gradient Boosting Survival (GBS), Random Survival Forest (RSF), Survival Support Vector Machine (SSVM), XGBoost Cox (XGB-Cox), XGBoost Accelerated Failure Time (XGB-AFT) e LightGBM (LGBM). Cada um adota uma estratégia distinta para modelar o tempo até a ocorrência de um evento e foram escolhidos por sua capacidade de lidar com censura nos dados, capturar padrões não lineares e fornecer predições mais flexíveis em comparação com abordagens estatísticas tradicionais. Os aspectos metodológicos relativos ao tratamento do banco de dados, bem como referente às especificidades de cada tipo de modelo de SML, estão descritos de maneira mais aprofundada em outro trabalho 8 . Para a avaliação dos modelos de sobrevida, foram utilizadas três métricas: Concordance Index (C-Index), Inverse Probability of Censoring Weighted Concordance Index (C-Index IPCW) e Integrated Brier Score (IBS). O C-Index é uma métrica empregada para medir a capacidade discriminatória do modelo, ou seja, sua habilidade de ordenar corretamente os tempos de sobrevida dos indivíduos 10 . Valores próximos a 1 indicam concordância perfeita, enquanto um valor de 0,5 sugere desempenho equivalente ao acaso. O C-Index IPCW é uma variação do C-Index que corrige vieses introduzidos pela censura não informativa ou dependente de covariáveis 11 . Por fim, o IBS mede a exatidão das predições de probabilidade de sobrevivência ao longo do tempo, sendo calculado a partir das curvas de sobrevida estimadas pelos modelos. Valores mais baixos indicam melhor desempenho, sendo 0 a predição perfeita 12 . Como o IBS depende das curvas de sobrevida, ele somente foi calculado para os modelos que apresentaram curvas de sobrevida adequadas e consistentes com as observações empíricas. A seleção dos hiperparâmetros dos modelos de aprendizado de máquina foi realizada com o Optuna 13 , utilizando três amostradores distintos. O RandomSampler combina os parâmetros de forma aleatória; o TPESampler 14 otimiza a escolha por meio de modelos probabilísticos; e o CmaEsSampler 15 emprega uma estratégia evolucionária que ajusta uma distribuição gaussiana sobre o espaço de hiperparâmetros. Cada amostrador foi avaliado com 150 combinações distintas, aplicando validação cruzada em 10 folds para cada conjunto de parâmetros. Para cada tipo de câncer, selecionou-se o modelo com melhor desempenho entre os três amostradores. Para avaliar o impacto das diferentes variáveis nas predições dos modelos de sobrevida, utilizou-se o SHapley Additive exPlanations (SHAP) 16 e o Permutation Importance (PI) 17 . O SHAP estima a contribuição média de cada variável para as predições, considerando todas as combinações possíveis de valores, enquanto o PI avalia a perda de desempenho do modelo quando os valores de uma variável são embaralhados de maneira aleatória. Aspectos Éticos Este estudo foi realizado com uma base de dados pública, anonimizada e sem variáveis sensíveis que permitissem identificação dos indivíduos, preservando a confidencialidade. Desta forma, não foi submetido a um Comitê de Ética em Pesquisa, de acordo com a Resolução nº 510/2016 do Conselho Nacional de Saúde. RESULTADOS O banco de dados foi obtido do RHC/SP em setembro de 2024 com dados de 1.223.973 indivíduos. Após as seleções gerais e específicas por tipo de câncer, foram incluídos 141.726 pacientes com câncer de mama, 111.406 com câncer de próstata, 45.719 com câncer de pulmão, 44.856 com câncer colorretal e 27.850 com câncer do colo do útero, conforme descrito no Quadro 1. Quadro 1Ajustes e seleções feitas nos conjuntos de dados do RHC/SP. Total de pacientes no RHC/SPExclusões geraisSeleções específicasTotal de pacientes incluídosCâncer de mama (C50)170.413 Idade < 20 anosResidentes em outros estadosEstadiamento clínico indefinido ou não realizadoSem confirmação microscópica do diagnósticoMorfologia incertaCarcinoma in situ Realização de transplante de medula óssea Sexo feminino141.726Câncer de próstata (C61)128.575(Nenhuma seleção específica adicional)111.406Câncer de pulmão (C34)57.620Sem tratamento com hormonioterapia45.719Câncer colorretal (C18, C19, C20)90.625Adenocarcinoma (morfologia = 81403)44.856Câncer do colo do útero (C53)56.912(Nenhuma seleção específica adicional)27.850RHC/SP: Registro Hospitalar de Câncer do estado de São Paulo. Quadro 1Ajustes e seleções feitas nos conjuntos de dados do RHC/SP. Total de pacientes no RHC/SPExclusões geraisSeleções específicasTotal de pacientes incluídosCâncer de mama (C50)170.413 Idade < 20 anosResidentes em outros estadosEstadiamento clínico indefinido ou não realizadoSem confirmação microscópica do diagnósticoMorfologia incertaCarcinoma in situ Realização de transplante de medula óssea Sexo feminino141.726Câncer de próstata (C61)128.575(Nenhuma seleção específica adicional)111.406Câncer de pulmão (C34)57.620Sem tratamento com hormonioterapia45.719Câncer colorretal (C18, C19, C20)90.625Adenocarcinoma (morfologia = 81403)44.856Câncer do colo do útero (C53)56.912(Nenhuma seleção específica adicional)27.850RHC/SP: Registro Hospitalar de Câncer do estado de São Paulo. Ajustes e seleções feitas nos conjuntos de dados do RHC/SP. Idade < 20 anos Idade < 20 anos Residentes em outros estados Residentes em outros estados Estadiamento clínico indefinido ou não realizado Estadiamento clínico indefinido ou não realizado Sem confirmação microscópica do diagnóstico Sem confirmação microscópica do diagnóstico Morfologia incerta Morfologia incerta Carcinoma in situ Carcinoma in situ Realização de transplante de medula óssea Realização de transplante de medula óssea RHC/SP: Registro Hospitalar de Câncer do estado de São Paulo. O perfil dos pacientes incluídos no estudo é apresentado na Tabela 1. O número de pacientes incluídos para cada tipo de câncer variou de 27.850 casos de colo do útero a 141.726 casos de mama, passando por 44.856 de colorretal, 45.719 de pulmão e 111.406 de próstata. No câncer de pulmão e no câncer colorretal, observou-se predomínio de pacientes do sexo masculino, correspondendo a 60,2% e 52,0% dos casos, respectivamente. Tabela 1Perfil de pacientes incluídos no estudo. Mama n (%)Próstata n (%)Pulmão n (%)Colorretal n (%)Colo do útero n (%)Escolaridade Analfabeto4.997 (3,53)5.257 (4,72)2.418 (5,29)1.670 (3,72)2.066 (7,42)Ensino Fundamental Incompleto33.601 (23,71)34.875 (31,30)13.717 (30,00)11.549 (25,75)8.167 (29,33)Ensino Fundamental Completo22.536 (15,90)18.557 (16,66)8.967 (19,61)8.198 (18,28)4.527 (16,26)Ensino Médio25.771 (18,18)13.009 (11,68)5.387 (11,78)6.302 (14,05)4.022 (14,44)Ensino Superior15.651 (11,04)7.986 (7,17)3.022 (6,61)3.431 (7,65)1.197 (4,30)Sem informação39.170 (27,64)31.722 (28,47)12.208 (26,70)13.706 (30,56)7.871 (28,26)Idade - Média (Mediana)56,46 (56)67,58 (68)64,01 (64)62,39 (63)51,53 (51)Sexo Masculino0 (0)111.406 (100)27.530 (60,21)23.312 (51,97)0 (0)Feminino141.726 (100)0 (0)18.189 (39,78)21.544 (48,03)27.850 (100)Categoria de atendimento Convênio16.487 (11,63)10.621 (9,53)3.544 (7,75)3.991 (8,90)1.064 (3,82)SUS82.721 (58,37)68.698 (61,66)25.477 (55,72)28.149 (62,75)16.426 (58,98)Particular906 (0,64)1.691 (1,52)341 (0,74)299 (0,67)74 (0,27)Sem Informação41.612 (29,36)30.396 (27,28)16.357 (35,77)12.417 (27,68)10.286 (36,93)Diagnóstico prévio Sem diagnóstico prévio69.411 (48,98)36.225 (32,52)29.816 (65,22)18.255 (40,70)11.761 (42,23)Com diagnóstico prévio72.315 (51,02)75.181 (67,48)15.903 (34,78)26.601 (59,30)16.089 (57,77)Topografia C500: 4.512 (3,18)C501: 6.651 (4,69)C502: 9.188 (6,48)C503: 5.195 (3,67)C504: 34.244 (24,16)C505: 6.339 (4,47)C506: 1.300 (0,92)C508: 21.803 (15,38)C509: 52.494 (37,04) C619: 111.406 (100) C340: 2.499 (5,47)C341: 12.982 (28,40)C342: 1.340 (2,93)C343: 6.736 (14,73)C348: 1.679 (3,67)C349: 20.483 (44,80) C180: 1.371 (3,06)C181: 81 (0,18)C182: 3.547 (7,91)C183: 379 (0,84)C184: 1.616 (3,60)C185: 327 (0,73)C186: 1.996 (4,45)C187: 6.638 (14,80)C188: 297 (0,66)C189: 6.955 (15,51)C199: 2.791 (6,22)C209: 18.858 (42,04) C530: 759 (2,73)C531: 1.243 (4,46)C538: 443 (1,59)C539: 25.405 (91,22) Estadiamento clínico I33.780 (23,83)9.133 (8,20)4.936 (10,80)5.378 (11,99)8.346 (29,97)II54.970 (38,79)65.986 (59,23)2.937 (6,42)12.400 (27,64)6.544 (23,50)III38.224 (26,97)18.659 (16,75)12.037 (26,33)14.393 (32,09)8.722 (31,32)IV14.752 (10,41)17.628 (15,82)25.809 (56,45)12.685 (28,28)4.238 (15,22)Tempo categorizado entre a primeira consulta e o início do tratamento Até 60 dias84.201 (59,41)51.357 (46,10)25.728 (56,27)31.905 (71,13)15.504 (55,67)Entre 61 e 90 dias23.604 (16,65)13.299 (11,94)5.056 (11,06)5.030 (11,21)4.709 (16,91)Mais de 91 dias31.390 (22,15)39.839 (35,76)7.008 (15,33)5.743 (12,80)6.245 (22,42)Não tratou2.531 (1,79)6.911 (6,20)7.927 (17,34)2.178 (4,86)1.392 (5,00)Tempo categorizado entre o diagnóstico e o início do tratamento Até 60 dias69.639 (49,14)31.301 (28,10)26.809 (58,64)25.554 (56,97)11.608 (41,68)Entre 61 e 90 dias26.803 (18,91)14.725 (13,22)5.035 (11,01)7.019 (15,65)5.211 (18,71)Mais de 91 dias42.753 (30,17)58.469 (52,48)5.948 (13,01)10.105 (22,53)9.639 (34,61)Não tratou2.531 (1,79)6.911 (6,20)7.927 (17,34)2.178 (4,86)1.392 (5,00)Óbito por todas as causas Não95.069 (67,08)75.027 (67,35)6.808 (14,89)22.979 (51,23)15.333 (55,06)Sim46.657 (32,92)36.379 (32,65)38.911 (85,11)21.877 (48,77)12.517 (44,94)Divisão do modelo Treino113.380 (80,00)89.124 (80,00)36.575 (80,00)35.884 (80,00)22.280 (80,00)Teste28.346 (20,00)22.282 (20,00)9.144 (20,00)8.972 (20,00)5.570 (20,00)Total141.726 (100)111.406 (100)45.719 (100)44.856 (100)27.850 (100) Tabela 1Perfil de pacientes incluídos no estudo. Mama n (%)Próstata n (%)Pulmão n (%)Colorretal n (%)Colo do útero n (%)Escolaridade Analfabeto4.997 (3,53)5.257 (4,72)2.418 (5,29)1.670 (3,72)2.066 (7,42)Ensino Fundamental Incompleto33.601 (23,71)34.875 (31,30)13.717 (30,00)11.549 (25,75)8.167 (29,33)Ensino Fundamental Completo22.536 (15,90)18.557 (16,66)8.967 (19,61)8.198 (18,28)4.527 (16,26)Ensino Médio25.771 (18,18)13.009 (11,68)5.387 (11,78)6.302 (14,05)4.022 (14,44)Ensino Superior15.651 (11,04)7.986 (7,17)3.022 (6,61)3.431 (7,65)1.197 (4,30)Sem informação39.170 (27,64)31.722 (28,47)12.208 (26,70)13.706 (30,56)7.871 (28,26)Idade - Média (Mediana)56,46 (56)67,58 (68)64,01 (64)62,39 (63)51,53 (51)Sexo Masculino0 (0)111.406 (100)27.530 (60,21)23.312 (51,97)0 (0)Feminino141.726 (100)0 (0)18.189 (39,78)21.544 (48,03)27.850 (100)Categoria de atendimento Convênio16.487 (11,63)10.621 (9,53)3.544 (7,75)3.991 (8,90)1.064 (3,82)SUS82.721 (58,37)68.698 (61,66)25.477 (55,72)28.149 (62,75)16.426 (58,98)Particular906 (0,64)1.691 (1,52)341 (0,74)299 (0,67)74 (0,27)Sem Informação41.612 (29,36)30.396 (27,28)16.357 (35,77)12.417 (27,68)10.286 (36,93)Diagnóstico prévio Sem diagnóstico prévio69.411 (48,98)36.225 (32,52)29.816 (65,22)18.255 (40,70)11.761 (42,23)Com diagnóstico prévio72.315 (51,02)75.181 (67,48)15.903 (34,78)26.601 (59,30)16.089 (57,77)Topografia C500: 4.512 (3,18)C501: 6.651 (4,69)C502: 9.188 (6,48)C503: 5.195 (3,67)C504: 34.244 (24,16)C505: 6.339 (4,47)C506: 1.300 (0,92)C508: 21.803 (15,38)C509: 52.494 (37,04) C619: 111.406 (100) C340: 2.499 (5,47)C341: 12.982 (28,40)C342: 1.340 (2,93)C343: 6.736 (14,73)C348: 1.679 (3,67)C349: 20.483 (44,80) C180: 1.371 (3,06)C181: 81 (0,18)C182: 3.547 (7,91)C183: 379 (0,84)C184: 1.616 (3,60)C185: 327 (0,73)C186: 1.996 (4,45)C187: 6.638 (14,80)C188: 297 (0,66)C189: 6.955 (15,51)C199: 2.791 (6,22)C209: 18.858 (42,04) C530: 759 (2,73)C531: 1.243 (4,46)C538: 443 (1,59)C539: 25.405 (91,22) Estadiamento clínico I33.780 (23,83)9.133 (8,20)4.936 (10,80)5.378 (11,99)8.346 (29,97)II54.970 (38,79)65.986 (59,23)2.937 (6,42)12.400 (27,64)6.544 (23,50)III38.224 (26,97)18.659 (16,75)12.037 (26,33)14.393 (32,09)8.722 (31,32)IV14.752 (10,41)17.628 (15,82)25.809 (56,45)12.685 (28,28)4.238 (15,22)Tempo categorizado entre a primeira consulta e o início do tratamento Até 60 dias84.201 (59,41)51.357 (46,10)25.728 (56,27)31.905 (71,13)15.504 (55,67)Entre 61 e 90 dias23.604 (16,65)13.299 (11,94)5.056 (11,06)5.030 (11,21)4.709 (16,91)Mais de 91 dias31.390 (22,15)39.839 (35,76)7.008 (15,33)5.743 (12,80)6.245 (22,42)Não tratou2.531 (1,79)6.911 (6,20)7.927 (17,34)2.178 (4,86)1.392 (5,00)Tempo categorizado entre o diagnóstico e o início do tratamento Até 60 dias69.639 (49,14)31.301 (28,10)26.809 (58,64)25.554 (56,97)11.608 (41,68)Entre 61 e 90 dias26.803 (18,91)14.725 (13,22)5.035 (11,01)7.019 (15,65)5.211 (18,71)Mais de 91 dias42.753 (30,17)58.469 (52,48)5.948 (13,01)10.105 (22,53)9.639 (34,61)Não tratou2.531 (1,79)6.911 (6,20)7.927 (17,34)2.178 (4,86)1.392 (5,00)Óbito por todas as causas Não95.069 (67,08)75.027 (67,35)6.808 (14,89)22.979 (51,23)15.333 (55,06)Sim46.657 (32,92)36.379 (32,65)38.911 (85,11)21.877 (48,77)12.517 (44,94)Divisão do modelo Treino113.380 (80,00)89.124 (80,00)36.575 (80,00)35.884 (80,00)22.280 (80,00)Teste28.346 (20,00)22.282 (20,00)9.144 (20,00)8.972 (20,00)5.570 (20,00)Total141.726 (100)111.406 (100)45.719 (100)44.856 (100)27.850 (100) Perfil de pacientes incluídos no estudo. C500: 4.512 (3,18) C500: 4.512 (3,18) C501: 6.651 (4,69) C501: 6.651 (4,69) C502: 9.188 (6,48) C502: 9.188 (6,48) C503: 5.195 (3,67) C503: 5.195 (3,67) C504: 34.244 (24,16) C504: 34.244 (24,16) C505: 6.339 (4,47) C505: 6.339 (4,47) C506: 1.300 (0,92) C506: 1.300 (0,92) C508: 21.803 (15,38) C508: 21.803 (15,38) C509: 52.494 (37,04) C509: 52.494 (37,04) C619: 111.406 (100) C619: 111.406 (100) C340: 2.499 (5,47) C340: 2.499 (5,47) C341: 12.982 (28,40) C341: 12.982 (28,40) C342: 1.340 (2,93) C342: 1.340 (2,93) C343: 6.736 (14,73) C343: 6.736 (14,73) C348: 1.679 (3,67) C348: 1.679 (3,67) C349: 20.483 (44,80) C349: 20.483 (44,80) C180: 1.371 (3,06) C180: 1.371 (3,06) C181: 81 (0,18) C181: 81 (0,18) C182: 3.547 (7,91) C182: 3.547 (7,91) C183: 379 (0,84) C183: 379 (0,84) C184: 1.616 (3,60) C184: 1.616 (3,60) C185: 327 (0,73) C185: 327 (0,73) C186: 1.996 (4,45) C186: 1.996 (4,45) C187: 6.638 (14,80) C187: 6.638 (14,80) C188: 297 (0,66) C188: 297 (0,66) C189: 6.955 (15,51) C189: 6.955 (15,51) C199: 2.791 (6,22) C199: 2.791 (6,22) C209: 18.858 (42,04) C209: 18.858 (42,04) C530: 759 (2,73) C530: 759 (2,73) C531: 1.243 (4,46) C531: 1.243 (4,46) C538: 443 (1,59) C538: 443 (1,59) C539: 25.405 (91,22) C539: 25.405 (91,22) A proporção de óbitos por todas as causas variou consideravelmente entre os tipos de câncer incluídos. Os casos de câncer de pulmão apresentaram a maior proporção de óbitos (85,1%), enquanto mama e próstata registraram a menor proporção de óbitos com valores próximos (32,9% e 32,7%, respectivamente). Colorretal (48,8%) e colo do útero (44,9%) situaram-se em patamares intermediários. A distribuição de acordo com a topografia, bem como a divisão entre treino e teste encontra-se no Material Suplementar a . As curvas de Kaplan-Meier estratificadas por estadiamento clínico também se encontram no Material Suplementar. A Tabela 2 apresenta o desempenho dos modelos de SML para predição de sobrevida após a otimização dos hiperparâmetros para os cinco tipos de câncer. No câncer de mama, o modelo XGB-AFT apresentou o melhor desempenho em termos de C-Index (0,7845) e C-Index IPCW (0,7570), enquanto o GBS obteve o menor IBS (0,1325). Já no câncer de próstata, o GBS destacou-se com os melhores valores de C-Index (0,7574) e C-Index IPCW (0,7332), além do menor IBS (0,1298). No cenário do câncer de pulmão, o modelo XGB-AFT obteve o maior C-Index (0,7368) e o maior C-Index IPCW (0,7325), embora o menor IBS tenha sido registrado pelo modelo GBS (0,1165). Para o câncer colorretal, o XGB-AFT apresentou novamente os maiores valores de C-Index (0,7618) e C-Index IPCW (0,7532), enquanto o menor IBS foi registrado pelo GBS (0,1552). Finalmente, no caso do câncer do colo do útero, o modelo XGB-Cox alcançou o maior C-Index (0,7726), enquanto o GBS obteve o maior C-Index IPCW (0,7643) e o menor IBS (0,1473). As curvas de sobrevida estão apresentadas no Material Suplementar. Tabela 2Sumário dos resultados obtidos pelos melhores modelos após a busca pelos hiperparâmetros.ModelosCâncer de mamaCâncer de próstataCâncer de pulmãoCâncer colorretalCâncer do colo do úteroC-IndexC-Index IPCWIBSC-IndexC-Index IPCWIBSC-IndexC-Index IPCWIBSC-IndexC-Index IPCWIBSC-IndexC-Index IPCWIBSRSF0,77840,75250,13350,75570,73000,13030,72470,72120,11920,75470,74890,15650,76640,75830,1481GBS0,78210,7565 0,1324 0,7574 0,7332 0,1298 0,73240,7288 0,1165 0,75880,7526 0,1552 0,7722 0,7643 0,1473 SSVM0,75740,73010,14150,70940,69070,14240,66860,66690,13100,70880,70360,17740,73720,73150,1630XGB - Cox0,70210,6896-0,67470,6645-0,72120,7174-0,72400,7184-0,74520,7375-XGB - AFT 0,7845 0,7570 -0,75740,7328- 0,7368 0,7325 - 0,7618 0,7532 - 0,7726 0,7639-LGBM0,71330,7000-0,68620,6742-0,72100,7170-0,72750,7211-0,74830,7404-Nota: em negrito, destacam-se os modelos que apresentaram o melhor desempenho para cada tipo de tumor e métrica avaliada.C-Index: Concordance Index; C-Index IPCW: Inverse Probability of Censoring Weighted Concordance Index; GBS: Gradient Boosting Survival; IBS: Integrated Brier Score; LGBM: LightGBM; RSF: Random Survival Forest; SSVM: Survival Support Vector Machine; XGB-Cox: XGBoost Cox; XGB-AFT: XGBoost Accelerated Failure Time. Tabela 2Sumário dos resultados obtidos pelos melhores modelos após a busca pelos hiperparâmetros.ModelosCâncer de mamaCâncer de próstataCâncer de pulmãoCâncer colorretalCâncer do colo do úteroC-IndexC-Index IPCWIBSC-IndexC-Index IPCWIBSC-IndexC-Index IPCWIBSC-IndexC-Index IPCWIBSC-IndexC-Index IPCWIBSRSF0,77840,75250,13350,75570,73000,13030,72470,72120,11920,75470,74890,15650,76640,75830,1481GBS0,78210,7565 0,1324 0,7574 0,7332 0,1298 0,73240,7288 0,1165 0,75880,7526 0,1552 0,7722 0,7643 0,1473 SSVM0,75740,73010,14150,70940,69070,14240,66860,66690,13100,70880,70360,17740,73720,73150,1630XGB - Cox0,70210,6896-0,67470,6645-0,72120,7174-0,72400,7184-0,74520,7375-XGB - AFT 0,7845 0,7570 -0,75740,7328- 0,7368 0,7325 - 0,7618 0,7532 - 0,7726 0,7639-LGBM0,71330,7000-0,68620,6742-0,72100,7170-0,72750,7211-0,74830,7404-Nota: em negrito, destacam-se os modelos que apresentaram o melhor desempenho para cada tipo de tumor e métrica avaliada.C-Index: Concordance Index; C-Index IPCW: Inverse Probability of Censoring Weighted Concordance Index; GBS: Gradient Boosting Survival; IBS: Integrated Brier Score; LGBM: LightGBM; RSF: Random Survival Forest; SSVM: Survival Support Vector Machine; XGB-Cox: XGBoost Cox; XGB-AFT: XGBoost Accelerated Failure Time. Sumário dos resultados obtidos pelos melhores modelos após a busca pelos hiperparâmetros. Nota: em negrito, destacam-se os modelos que apresentaram o melhor desempenho para cada tipo de tumor e métrica avaliada. C-Index: Concordance Index; C-Index IPCW: Inverse Probability of Censoring Weighted Concordance Index; GBS: Gradient Boosting Survival; IBS: Integrated Brier Score; LGBM: LightGBM; RSF: Random Survival Forest; SSVM: Survival Support Vector Machine; XGB-Cox: XGBoost Cox; XGB-AFT: XGBoost Accelerated Failure Time. O Quadro 2 apresenta as variáveis mais relevantes para a predição de sobrevida, identificadas por meio dos métodos SHAP e PI, para cada tipo de câncer analisado. Os modelos selecionados foram aqueles que apresentaram melhor desempenho na Tabela 2 de acordo com o C-Index IPCW: XGB-AFT para mama, pulmão e colorretal; GBS para próstata e colo do útero. A variável EC (estadiamento clínico) foi de forma consistente classificada como a mais importante nos modelos de câncer de mama, próstata, colo do útero e colorretal, tanto pelos métodos SHAP quanto PI, enquanto no câncer de pulmão ela foi a mais importante apenas de acordo com o método SHAP, sendo que no método PI o tempo categorizado entre a consulta e o tratamento foi a variável mais importante. A Figura apresenta o gráfico com a distribuição dos valores de SHAP. Quadro 2Importância das features pelos métodos SHAP e Permutation Importance. Câncer de mamaCâncer de próstataCâncer de pulmãoCâncer colorretalCâncer do colo do úteroXGB - AFTGBSXGB - AFTXGB - AFTGBSSHAPPISHAPPISHAPPISHAPPISHAPPI1ECECECECECTRATCONS_CATECECECEC2IDADEIDADEIDADEIDADETRATCONS_CATECIDADETRATCONS_CATDIAGTRAT_CATCATEATEND3CATEATENDCATEATENDCATEATENDCATEATENDDIAGTRAT_CATDIATRAT_CATCATEATENDIDADECATEATENDDIAGTRAT_CAT4ANODIAGANODIAGDIAGTRAT_CATDIAGTRAT_CATMORFOMORFOTRATCONS_CATINSTITUIDADEIDADE5IBGEATENIBGEATENANODIAGANODIAGTOPOINSTITUDIAGPREVCATEATENDANODIAGANODIAG6DIAGTRAT_CATINSTITUDIAGPREVINSTITUSEXOTOPOINSTITUANODIAGTRATCONS_CATINSTITU7TOPOTRATCONS_CATTRATCONS_CATTRATCONS_CATDIAGPREVDIAGPREVDIAGTRAT_CATDIAGTRAT_CATIBGEATENTRATCONS_CAT8DIAGPREVESCOLARIINSTITUIBGEATENIDADEIDADEANODIAGTOPOINSTITUIBGEATEN9ESCOLARIDIAGTRAT_CATMORFODRS_INSTCATEATENDCATEATENDTOPOIBGEATENHABILIT2ESCOLARI10TRATCONS_CATTOPOESCOLARIHABILIT2INSTITUANODIAGSEXODIAGPREVESCOLARIMORFOANODIAG: ano do diagnóstico; CATEATEND: categoria de atendimento; DIAGPREV: diagnóstico prévio à admissão; DIAGTRAT_CAT: tempo categorizado entre diagnóstico e início do tratamento; DRS: Departamento Regional de Saúde; DRS_INST: Departamento Regional de Saúde da instituição; EC: estadiamento clínico; ESCOLARI: escolaridade; GBS: Gradient Boosting Survival; HABILIT2: categoria de habilitação em alta complexidade em oncologia; IBGE: código IBGE da cidade de residência; IBGEATEN: código IBGE da cidade da instituição; IDADE: idade; INSTITU: código da instituição; MORFO: morfologia tumoral; PI: Permutation Importance; SHAP: SHapley Additive exPlanations; TOPO: topografia tumoral; TRATCONS_CAT: tempo categorizado entre primeira consulta e início do tratamento; XGB-AFT: XGBoost Accelerated Failure Time. Quadro 2Importância das features pelos métodos SHAP e Permutation Importance. Câncer de mamaCâncer de próstataCâncer de pulmãoCâncer colorretalCâncer do colo do úteroXGB - AFTGBSXGB - AFTXGB - AFTGBSSHAPPISHAPPISHAPPISHAPPISHAPPI1ECECECECECTRATCONS_CATECECECEC2IDADEIDADEIDADEIDADETRATCONS_CATECIDADETRATCONS_CATDIAGTRAT_CATCATEATEND3CATEATENDCATEATENDCATEATENDCATEATENDDIAGTRAT_CATDIATRAT_CATCATEATENDIDADECATEATENDDIAGTRAT_CAT4ANODIAGANODIAGDIAGTRAT_CATDIAGTRAT_CATMORFOMORFOTRATCONS_CATINSTITUIDADEIDADE5IBGEATENIBGEATENANODIAGANODIAGTOPOINSTITUDIAGPREVCATEATENDANODIAGANODIAG6DIAGTRAT_CATINSTITUDIAGPREVINSTITUSEXOTOPOINSTITUANODIAGTRATCONS_CATINSTITU7TOPOTRATCONS_CATTRATCONS_CATTRATCONS_CATDIAGPREVDIAGPREVDIAGTRAT_CATDIAGTRAT_CATIBGEATENTRATCONS_CAT8DIAGPREVESCOLARIINSTITUIBGEATENIDADEIDADEANODIAGTOPOINSTITUIBGEATEN9ESCOLARIDIAGTRAT_CATMORFODRS_INSTCATEATENDCATEATENDTOPOIBGEATENHABILIT2ESCOLARI10TRATCONS_CATTOPOESCOLARIHABILIT2INSTITUANODIAGSEXODIAGPREVESCOLARIMORFOANODIAG: ano do diagnóstico; CATEATEND: categoria de atendimento; DIAGPREV: diagnóstico prévio à admissão; DIAGTRAT_CAT: tempo categorizado entre diagnóstico e início do tratamento; DRS: Departamento Regional de Saúde; DRS_INST: Departamento Regional de Saúde da instituição; EC: estadiamento clínico; ESCOLARI: escolaridade; GBS: Gradient Boosting Survival; HABILIT2: categoria de habilitação em alta complexidade em oncologia; IBGE: código IBGE da cidade de residência; IBGEATEN: código IBGE da cidade da instituição; IDADE: idade; INSTITU: código da instituição; MORFO: morfologia tumoral; PI: Permutation Importance; SHAP: SHapley Additive exPlanations; TOPO: topografia tumoral; TRATCONS_CAT: tempo categorizado entre primeira consulta e início do tratamento; XGB-AFT: XGBoost Accelerated Failure Time. Importância das features pelos métodos SHAP e Permutation Importance. ANODIAG: ano do diagnóstico; CATEATEND: categoria de atendimento; DIAGPREV: diagnóstico prévio à admissão; DIAGTRAT_CAT: tempo categorizado entre diagnóstico e início do tratamento; DRS: Departamento Regional de Saúde; DRS_INST: Departamento Regional de Saúde da instituição; EC: estadiamento clínico; ESCOLARI: escolaridade; GBS: Gradient Boosting Survival; HABILIT2: categoria de habilitação em alta complexidade em oncologia; IBGE: código IBGE da cidade de residência; IBGEATEN: código IBGE da cidade da instituição; IDADE: idade; INSTITU: código da instituição; MORFO: morfologia tumoral; PI: Permutation Importance; SHAP: SHapley Additive exPlanations; TOPO: topografia tumoral; TRATCONS_CAT: tempo categorizado entre primeira consulta e início do tratamento; XGB-AFT: XGBoost Accelerated Failure Time. FiguraValores de SHAP para interpretabilidade dos modelos de melhor desempenho, segundo tipo de câncer.ANODIAG: ano do diagnóstico; CATEATEND: categoria de atendimento; DIAGPREV: diagnóstico prévio à admissão; DIAGTRAT_CAT: tempo categorizado entre diagnóstico e início do tratamento; DRS: Departamento Regional de Saúde; DRS_INST: Departamento Regional de Saúde da instituição; EC: estadiamento clínico; ESCOLARI: escolaridade; GBS: Gradient Boosting Survival; HABILIT2: categoria de habilitação em alta complexidade em oncologia; IBGE: código IBGE da cidade de residência; IBGEATEN: código IBGE da cidade da instituição; IDADE: idade; INSTITU: código da instituição; MORFO: morfologia tumoral; PI: Permutation Importance; SHAP: SHapley Additive exPlanations; TOPO: topografia tumoral; TRATCONS_CAT: tempo categorizado entre primeira consulta e início do tratamento; XGB-AFT: XGBoost Accelerated Failure Time.Nota: os valores de SHAP quantificam a contribuição de cada variável para as predições individuais, permitindo identificar tanto a importância global das variáveis quanto seu impacto na predição do modelo. Os gráficos do tipo beeswarm mostram a distribuição dos valores de SHAP, em que cada ponto representa um indivíduo; a cor indica o valor da variável (vermelho = valores mais altos; azul = valores mais baixos), e a posição no eixo x representa o impacto dessa variável na predição. (A) Mama - XGB-AFT; (B) Próstata - GBS; (C) Pulmão - XGB-AFT; (D) Colorretal - XGB-AFT; (E) Colo do útero - GBS. Valores de SHAP para interpretabilidade dos modelos de melhor desempenho, segundo tipo de câncer. DISCUSSÃO Este estudo se destaca ao demonstrar a aplicabilidade de modelos de SML para a predição da sobrevida em pacientes com cinco tipos de câncer. Os modelos apresentaram desempenho avaliado pelo C-Index, com valores entre 0,6686 e 0,7845, evidenciando o potencial dos algoritmos de SML para predizer a sobrevida a partir de dados coletados pelos registros de câncer. Os modelos GBS e XGB-AFT foram os que apresentaram as melhores métricas nos diversos tipos de câncer. O GBS foi superior no câncer de próstata, enquanto o XGB-AFT foi o melhor nos demais tipos de tumores. Já o RSF obteve o terceiro melhor resultado para todas as topografias. Ressalta-se ainda que os melhores algoritmos obtiveram bom desempenho preditivo, acima de 0,73, independentemente da proporção de casos censurados na amostra e do número total de pacientes incluídos. O GBS apresentou o melhor desempenho em relação ao IBS em todas as categorias de tumores. Em estudo prévio, nosso grupo já havia identificado boa capacidade de predição a partir dos dados do registro de câncer 6 . Considerando a sobrevida em cinco anos, obteve-se uma acurácia de 77,9% e uma AUC de 0,858 com o XGBoost. Entretanto, naquele estudo foi necessário excluir os indivíduos que não apresentavam período completo de seguimento. Desta forma, de um total de 31.916 pacientes elegíveis, somente 23.338 (73%) puderam ser utilizados na análise. Em outra publicação, ao realizar a comparação entre estes resultados e os algoritmos de SML, os resultados demonstraram que os algoritmos para desfecho dicotômicos subestimaram a sobrevida de pacientes com câncer colorretal em até 18% no 1º ano, demonstrando que os modelos de SML são mais adequados para este tipo de análise. Considerando o peso das entradas nos resultados dos modelos, a variável EC foi a mais importante em todas as análises, exceto na PI para o câncer de pulmão, em que ela ficou em segundo lugar. Este achado é consistente com o de outros autores 18 , e demonstra importância do estadiamento ao diagnóstico como principal fator prognóstico dos diversos tipos de câncer. No câncer de mama, o modelo XGB-AFT apresentou o melhor desempenho, com C-Index de 0,7845, superando os 0,73 obtidos em um estudo com 36.958 pacientes diagnosticadas na Holanda entre 2005 e 2008 19 . No estudo citado, o XGB obteve desempenho superior aos modelos Cox-PH, RSF e SSVM, cujos C-Indexes variaram entre 0,63 e 0,64. Na análise de importância das variáveis por SHAP, idade e estadiamento destacaram-se como os principais preditores, da mesma forma que encontramos no nosso estudo. Para o câncer de próstata, o melhor resultado foi alcançado com o modelo GBS (C-Index = 0,7574), superior ao encontrado em um estudo que utilizou a base de dados Surveillance, Epidemiology, and End Results (SEER), que congrega os dados de 18 registros de câncer de base populacional nos Estados Unidos 20 . Foram utilizados os dados de pacientes diagnosticados com câncer de próstata entre 2000 e 2019, com linfonodo positivo e sem metástases, com um total de 3.280 pacientes. Na referida investigação, foi obtido um valor de C-Index de 0,745 com a técnica Gradient Boosting Survival Analysis (GBSA) e com a Extra Survival Trees (EST), superior ao dos demais modelos analisados, RSF e Cox-PH, que variaram entre 0,734 e 0,743. No caso do câncer de pulmão, o XGB-AFT também se destacou (C-Index = 0,7368), superando os resultados obtidos em estudo que utilizou o registro de câncer de base populacional de um estado na Alemanha 21 . Foram utilizados os dados de pacientes diagnosticados com câncer de pulmão entre 2016 e 2021, com um total de 10.383 pacientes. Nesse estudo da literatura, o modelo RSF com imputação de variáveis obteve C-Index de 0,703, enquanto as demais abordagens (Cox-PH, DeepSurv e TabNet) apresentaram desempenho inferior (0,556 a 0,701). Para o câncer colorretal, o XGB-AFT obteve o maior C-Index da análise (0,7618), embora inferior ao encontrado em estudo desenvolvido com uma base de dados hospitalar na China 22 . Foram utilizados os dados de pacientes diagnosticados com câncer colorretal entre 2012 e 2019, com um total de 2.157 pacientes. No estudo citado, foi obtido o valor de C-Index de 0,789 para o DeepHit, enquanto as demais técnicas analisadas (Cox-PH, RSF, GB, DeepSurv, Cox-Time e Neural Multitask Logistic Regression) variaram entre 0,781 e 0,787. A variável mais importante na análise SHAP do modelo DeepHit foi o estadiamento. Cabe destacar que uma variável de destaque no estudo, a margem de ressecção cirúrgica, não está disponível no RHC/SP. Por fim, no câncer do colo do útero, o melhor algoritmo foi o XGB-AFT, que apresentou C-Index de 0,7726, abaixo do valor encontrado em estudo desenvolvido com a base de dados SEER 23 . Foram utilizados os dados de pacientes diagnosticadas com câncer do colo do útero entre 2013 e 2015, com um total de 3.810 pacientes. Nesse estudo da literatura, foi obtido o valor de C-Index de 0,95 para o RSF, enquanto o Cox-PH e Weibull obtiveram 0,81 e 0,80, respectivamente. A variável mais importante foi estágio T, seguida por tamanho do tumor e estadiamento. Foram utilizadas variáveis relacionadas ao tratamento, como quimioterapia e radioterapia, além da medida do tamanho do tumor, que são variáveis que optamos por não utilizar no nosso estudo. O uso de variáveis restritas a informações individuais, do local de residência, instituição de atendimento, características clínicas e tempo até o tratamento, sem incluir tipo de tratamento ou recorrência tumoral, constitui uma fortaleza do estudo. Essa escolha amplia a aplicabilidade dos modelos em contextos reais de planejamento, pois tais dados estão disponíveis precocemente nos registros. Assim, os algoritmos desenvolvidos podem apoiar decisões estratégicas da gestão em saúde, mesmo em cenários com dados clínicos limitados. Entretanto, a ausência de informações clínicas mais específicas, como marcadores tumorais e dados de recorrência, restringe seu uso para predição clínica individual, situando sua principal contribuição no apoio à gestão e à construção de cenários em saúde. Este estudo apresenta algumas limitações. A princípio, é importante destacar que o estudo utilizou informações do banco de dados do RHC/SP. Estes dados são coletados nos hospitais a partir dos prontuários por profissionais das próprias instituições, com equipes heterogêneas na sua composição. Embora todos os registradores recebam treinamento específico e utilizem o software SISRHC, que possui verificações internas e regras de consistência capazes de padronizar as informações, como restrição na seleção de morfologias compatíveis com cada topografia, ainda assim, podem ocorrer imprecisões, especialmente em variáveis mais complexas. Uma tentativa de mitigar este risco foi a exclusão de pacientes sem estadiamento ou com estadiamento indefinido, que sugerem pior qualidade do registro. Além disso, a base não captura atualmente alguns fatores relevantes para a sobrevida, como raça/cor, fatores de risco como tabagismo e dados clínicos como marcadores tumorais. Estes últimos têm especial importância, tendo em vista que impactam em definições mais precisas acerca do estadiamento e da probabilidade de sobrevida. Desta forma, a atualização dos sistemas de registro para inclusão de novas variáveis poderá ampliar o potencial preditivo dos modelos. Adicionalmente, deve ser considerado que não foi realizada comparação direta de desempenho com modelos de Cox. A aplicação desse tipo de modelo exige a proporcionalidade dos riscos ao longo do tempo, o que pode inviabilizar a inclusão de variáveis que não atendam a essa premissa 2 . Assim, sua utilização poderia restringir o conjunto de variáveis preditoras consideradas na análise. Outra limitação relevante é que não foi possível calcular o IBS para os modelos XGB-AFT, XGB-COX e LGBM, em razão da ausência de estimativas de curvas de sobrevida com aderência adequada aos dados observados, mesmo após tentativas de ajuste. Futuras investigações poderão explorar variações de parametrização, pré-processamento ou adaptações metodológicas específicas para esses algoritmos, de modo a viabilizar a obtenção de curvas confiáveis e, consequentemente, o cálculo do IBS. Além disso, cabe destacar a impossibilidade de utilizar o SurvSHAP 24 , método específico para avaliar impacto das diferentes variáveis nas predições modelos de sobrevida. Isso ocorreu porque sua aplicação exige a geração de explicações individuais ao longo de múltiplos pontos do tempo de sobrevida, tornando o processamento particularmente oneroso em bases extensas e em modelos mais complexos. Desta forma, optou-se pela adoção do SHAP 16 tradicional e do PI 17 para a avaliação global da importância das variáveis. Por fim, embora os modelos tenham apresentado bom desempenho nos dados do RHC/SP, sua aplicação em registros de outras regiões do país não foi testada. Destaca-se que uma variável de grande importância para os modelos, estadiamento clínico, tem valores de não-preenchimento elevados em algumas regiões do País, o que pode limitar a sua aplicação. Essa ausência de validação externa limita a extrapolação dos resultados para outros estados, o que pode ser objeto de futuros estudos que explorem a robustez desses modelos em bases nacionais de registro de câncer mais heterogêneas. CONCLUSÕES Os algoritmos de SML mostraram-se aplicáveis aos dados do RHC/SP para análise de sobrevida. O GBS, o XGB-AFT e o RSF apresentaram melhor desempenho, independentemente do tamanho da amostra ou da proporção de censura. Os resultados reforçam o potencial desses modelos para apoiar políticas públicas orientadas por evidências, identificando perfis de pacientes ou serviços com maior risco e contribuindo para o melhor direcionamento de recursos e organização das redes assistenciais. Material suplementar disponível em: https://doi.org/10.5281/zenodo.19250128