Abstract
This paper introduces a novel statistical methodology integrating machine learning (ML) and Bayesian modelling to facilitate personalized prognostic predictions with application to oncology. Utilizing power priors, we construct 'patient-similarity embeddings' that identify localized patterns of prognosis. The methodology is applied to study the prognostic value of markers of anticancer immunity within the tumour microenvironment of nonsmall cell lung cancer while adjusting for established clinical characteristics. The method outperforms traditional regression and ML models, while accurately identifying subgroup patterns, thereby enhancing statistical inference and hypothesis testing.