Objectives: Predicting the prognosis of lung cancer is crucial for providing optimal medical care. However, a method to accurately predict the overall prognosis in patients with stage IV lung cancer, even with the use of machine learning, has not been established. Moreover, the inter-institutional generalizability of such algorithms remains unexplored. This study aimed to establish machine learning-based algorithms with inter-institutional generalizability to predict prognosis., Materials and Methods: This multicenter, retrospective, hospital-based cohort study included consecutive patients with stage IV lung cancer who were randomly categorized into the training and independent test cohorts with a 2:1 ratio, respectively. The primary metric to assess algorithm performance was the area under the receiver operating characteristic curve in the independent test cohort. To assess the inter-institutional generalizability of the algorithms, we investigated their ability to predict patient outcomes in the remaining facility after being trained using data from 15 other facilities., Results: Overall, 6,751 patients (median age, 70 years) were enrolled, and 1,515 (22 %) showed mutated epidermal growth factor receptor expression. The median overall survival was 16.6 (95 % confidence interval, 15.9-17.5) months. Algorithm performance metrics in the test cohort showed that the areas under the curves were 0.90 (95 % confidence interval, 0.88-0.91), 0.85 (0.84-0.87), 0.83 (0.81-0.85), and 0.85 (0.82-0.87) at 180, 360, 720, and 1,080 predicted survival days, respectively. The performance test of 16 algorithms for investigating inter-institutional generalizability showed median areas under the curves of 0.87 (range, 0.84-0.92), 0.84 (0.78-0.88), 0.84 (0.76-0.89), and 0.84 (0.75-0.90) at 180, 360, 720, and 1,080 days, respectively., Conclusion: This study developed machine learning algorithms that could accurately predict the prognosis in patients with stage IV lung cancer with high inter-institutional generalizability. This can enhance the accuracy of prognosis prediction and support informed and shared decision-making in clinical settings., Competing Interests: Declaration of competing interest The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper. The authors declare the following financial interests/personal relationships which may be considered as potential competing interests: Daichi Fujimoto reported receiving grants and personal fees from AstraZeneca KK and Boehringer Ingelheim Japan Inc. and personal fees from Ono Pharmaceutical Co., Ltd., Bristol-Myers Squibb Co., Ltd., Takeda Pharmaceutical Co., Ltd., Taiho Pharmaceutical Co., Ltd., Chugai Pharmaceutical Co., Ltd., MSD KK, Eli Lilly Japan K.K., Kyowa Kirin, Daiichi Sankyo, and Novartis Pharma KK outside the submitted work. Hidetoshi Hayashi reported receiving grants from PAREXEL International Corp., Daiichi Sankyo Co., Ltd., Taiho Pharmaceutical Co., Ltd., MSD K.K., Ono Pharmaceutical Co., Ltd., SYNEOS HEALTH CLINICAL K.K., Covance Japan Inc., Sanofi K.K., Novartis Pharma K.K., Bristol Myers Squibb Company, Janssen Pharmaceutical K.K., Eisai Co., Ltd., Japan Clinical Research Operations, AstraZeneca K.K., Chugai Pharmaceutical Co., Ltd., Sysmex Corporation, Takeda Pharmaceutical Co., Ltd., IQVIA Services JAPAN K.K., GlaxoSmithKline K.K., EPS Corporation, Medical Research Support, PRA Health Science, Inc., Eisai., Inc., Nippon Boehringer Ingelheim Co., Ltd., and PPD-SNBL K.K. and personal fees from AstraZeneca K.K., Bristol Myers Squibb Company, Amgen, Inc., Chugai Pharmaceutical Co., Ltd., Eli Lilly Japan K.K., Ono Pharmaceutical Co., Ltd., and Pfizer Japan Inc outside the submitted work. Yukihiro Toi reported receiving personal fees from Bristol-Myers Squibb Company, Ono Pharmaceutical Co., Ltd., MSD K.K., AstraZeneca K.K., Chugai Pharmaceutical Co., Ltd., Taiho Pharmaceutical Co., Ltd., Pfizer, Inc., and Kyowa Kirin Co., Ltd., outside the submitted work. Toshihide Yokoyama reported receiving personal fees from AstraZeneca K.K., Chugai Pharmaceutical Co., Ltd., Eli Lilly Japan K.K., Pfizer Japan Inc, Bristol-Myers Squibb Co., Ltd., Ono Pharmaceutical Co., Ltd., Takeda Pharmaceutical Co., Ltd., Nippon Kayaku Co., Ltd., MSD, Novartis, and Merck Biopharma Co., Ltd. outside the submitted work. Terufumi Kato reported receiving grants from Abbvie, Amgen, AstraZeneca, BeiGene, BluePrint, Chugai, Daiichi-Sankyo, Eli Lilly, Haihe, Merck KGaA, MSD, Novartis, Pfizer, Regeneron, Takeda, and TurningPoint and personal fees from Amgen, AstraZeneca, BeiGene, Boehringer Ingelheim, Chugai, Daiichi-Sankyo, Eli Lilly, GlaxoSmithKline, Janssen, Merck KGaA, MSD, Novartis, Ono, Pfizer, Taiho, and Takeda outside the submitted work, and his wife is an employee of Eli Lilly. Teppei Yamaguchi reported receiving personal fees from Ono Pharmaceutical, Chugai Pharmaceutical, Eli Lilly, Taiho Pharmaceutical, AstraZeneca, MSD, Bristol-Meyers Squibb, and Novartis outside the submitted work. Kaoru Tanaka reported receiving personal fees from AstraZeneca, Merck Biopharma, Eisai, Bristol-Myers Squibb, Ono Pharmaceutical, MSD, Chugai Pharmaceutical, Takeda Pharmaceutical Co., Ltd., Taiho Pharmaceutical, and Novartis Pharma outside the submitted work. Satoru Miura reported receiving personal fees from AstraZeneca KK, Ono Pharmaceutical Co., Ltd., Bristol-Myers Squibb Co., Ltd., Taiho Pharmaceutical Co., Ltd., Chugai Pharmaceutical Co., Ltd., MSD K.K., Boehringer Ingelheim Japan Inc, Eli Lilly Japan K.K., Novartis Pharma K.K., Pfizer, Kyowa Hakko Kirin, Daiichi Sankyo, Abbive, Nippon Kayaku, AMGEN, Merck, and Takeda Pharmaceutical Co., Ltd. outside the submitted work. Motohiro Tamiya reported receiving personal fees from Pfizer, Chugai Pharmaceutical, Ono Pharmaceutical, MSD, Boehringer Ingelheim, AstraZeneca, Taiho Pharmaceutical, Eli Lilly, Bristol-Myers Squibb, and Amgen outside the submitted work. Motoko Tachihara reported receiving grants and personal fees from AstraZeneca K.K., Chugai Pharmaceutical Co., Ltd., and Eli Lilly Japan Co., Ltd., and personal fees from Ono Pharmaceutical Co., Ltd., Bristol-Myers Squibb Co., Ltd., MSD K.K., Novartis pharmaceuticals K.K., Takeda Pharmaceutical Co., Ltd., Taiho Pharmaceutical Co., Ltd., Nippon Boehringer Ingelheim Co., Ltd., Daiichi Sankyo, Pfizer Japan, Inc., and Janssen Pharmaceutical K.K. Takehito Shukuya reported receiving grants and personal fees from AstraZeneca, Chugai Pharmaceutical, Boehringer Ingelheim, Novartis, and MSD and personal fees from Taiho Pharma, Daiichi-Sankyo, Ono Pharmaceutical, Bristol-Myers Squibb, Nippon Kayaku, Pfizer, Takeda Pharmaceutical Co., Ltd., and Eli Lilly outside the submitted work. Yuko Tsuchiya-Kawano reported receiving personal fees from Bristol-Myers Squibb, Taiho Pharmaceutical, Chugai Pharmaceutical, AstraZeneca, Kyowa Hakko Kirin, MSD, and Ono Pharmaceutical outside the submitted work. Yuki Sato reported receiving personal fees from AstraZeneca, MSD, Novartis, Chugai Pharmaceutical, Ono Pharmaceutical, Pfizer, Taiho Pharmaceutical, Nippon Kayaku, Bristol Myers Squibb, Eli Lilly, Takeda Pharmaceutical Co., Ltd., Kyowa Kirin, and Boehringer Ingelheim outside the submitted work. Satoshi Ikeda reported receiving personal fees from AstraZeneca, Bristol Myers Squibb, Ono Pharmaceutical, Chugai Pharmaceutical, Taiho Pharmaceutical, Boehringer Ingelheim, Eli Lilly, Takeda Pharmaceutical Co., Ltd., Daiichi-Sankyo, and Pfizer outside the submitted work. Shinya Sakata reported receiving personal fees from AstraZeneca, Chugai Pharmaceutical Co., Ltd., Taiho Pharmaceutical, and Takeda Pharmaceutical outside the submitted work. Takeshi Masuda reported receiving personal fees from MSD K.K., Eli Lilly Japan K.K., Chugai Pharmaceutical Co., Ltd., Taiho Pharmaceutical Co., Ltd., AstraZeneca K.K., Ono Pharmaceutical Co., Ltd., Bristol-Myers Squibb Co., Ltd., and Kyowa Kirin outside the submitted work. Isamu Okamoto reported receiving personal fees from Nippon Boehringer Ingelheim Co., Ltd., AstraZeneca Plc., Eli Lilly Japan K.K., Takeda Pharmaceutical Co., Ltd., and Novartis Pharma K.K. outside the submitted work. Nobuyuki Yamamoto reported receiving grants from AstraZeneca K.K., MSD K.K., Amgen Astellas BioPharma, Eisai Co., Ltd., Sanofi K.K., Chugai Pharmaceutical Co., Ltd., Eli Lilly Japan K.K., Novartis Pharma K.K., Janssen Pharmaceutical K.K., Amgen K.K., Taiho Pharmaceutical Co., Ltd., Toppan USA, Inc., Nippon Boehringer Ingelheim Co., Ltd., and Daiichi Sankyo Co., Ltd. and personal fees from MSD K.K., Amgen K.K., Takeda Pharmaceutical Co., Ltd., Eli Lilly Japan K.K., Nippon Boehringer Ingelheim Co., Ltd., AstraZeneca K.K., Ono Pharmaceutical Co., Ltd., Chugai Pharmaceutical Co., Ltd., Novartis Pharma K.K., and Merck Biopharma Co., Ltd., outside the submitted work. The remaining authors declare no conflicts of interest., (Copyright © 2024 Elsevier B.V. All rights reserved.)