Abstract
Earlypredictionoflungcancerriskusingpatientandlifestyle information can support timely screening and clinical decision making. Existing machine learning studies have shown good performance for lung cancer prediction. However, model decisions are often difficult to understand clinically. In addition, predicted risk scores are not always evaluated and performance beyond the main dataset is still not well established. To address these issues, we propose an interpretable framework that integrates Graph Fusion and Role Stability for Robust Feature Selection (GRAFTS), a method that selects stable features using graph relationships, role consistency, and redundancy control. We also introduce Token-Based Feature-Gated Transformer (TabFGT), a customized token-based transformer that preserves feature identity and improves learning through gated refinement. We control data leakage
strictly and use 5 × 2 nested cross-validation (CV) and hyperparameter (HP) tuning. We also compared the model with baseline models and other feature selection methods. The final TabFGT model achieved 0.9800 accuracy and 0.9982 ROC-AUC on the held-out test set. The nested CV results remained consistent showing stable performance. Calibration analysis also showed reliable model outputs with low Brier error and low Expected Calibration Error (ECE). We also performed external and cross-dataset validation on three public datasets, where the model achieved accuracies of 0.9825, 0.9875, and 1.0000. Model decisions were further examined through explainable AI (XAI) analyses using SHapley Additive exPlanations (SHAP), Local Interpretable Modelagnostic Explanations (LIME), Partial Dependence Plots (PDP), Individual Conditional Expectation (ICE), and Accumulated Local Effects(ALE). Overall, the proposed framework offers an accurate, well calibrated and interpretable method for lung cancer prediction.