ImportanceIdentifying the optimal long-term biologic therapy for patients with psoriasis is often done through trial and error.ObjectiveTo identify the optimal biologic therapy for individual patients with psoriasis using predictive statistical and machine learning models.Design, Setting, and ParticipantsThis population-based cohort study used data from Danish nationwide registries, primarily DERMBIO, and included adult patients treated for moderate-to-severe psoriasis with biologics. Data were processed and analyzed between spring 2021 and spring 2022.Main Outcomes and MeasuresPatient clusters of clinical relevance were identified and their success rates estimated for each drug. Furthermore, predictive prognostic models to identify optimal biologic treatment at the individual level based on data from nationwide registries were evaluated.ResultsAssuming a success criterion of 3 years of sustained treatment, this study included 2034 patients with a total of 3452 treatment series. Most treatment series involved male patients (2147 [62.2%]) originating from Denmark (3190 [92.4%]), and 2414 (69.9%) had finished an education longer than primary school. The average ages were 24.9 years at psoriasis diagnosis and 45.5 years at initiation of biologic therapy. Gradient-boosted decision trees and logistic regression were able to predict a specific cytokine target (eg, interleukin-17 inhibition) associated with a successful treatment with accuracies of 63.6% and 59.2%, and top 2 accuracies of 95.9% and 93.9%. When predicting specific drugs resulting in success, gradient boost and logistic regression had accuracies of 48.5% and 44.4%, top 2 accuracies of 77.6% and 75.9%, and top 3 accuracies of 89.9% and 89.0%.Conclusions and RelevanceOf the treatment prediction models used in this cohort study of patients with psoriasis, gradient-boosted decision trees performed significantly better than logistic regression when predicting specific biologic therapy (by drug as well as target) leading to a treatment duration of at least 3 years without discontinuation. Predicting the optimal biologic could benefit patients and clinicians by minimizing the number of failed treatment attempts.