Medication adherence plays a critical role in controlling the evolution of chronic disease, as low medication adherence may lead to worse health outcomes, higher mortality, and morbidity. Assessment of their patients' medication adherence by clinicians is essential for avoiding inappropriate therapeutic intensification, associated health care expenditures, and the inappropriate inclusion of patients in time- and resource-consuming educational interventions. In both research and clinical practices the most extensively used measures of medication adherence are patient-reported outcome measures (PROMs), because of their ability to capture subjective dimensions of nonadherence. Machine learning (ML), a subfield of artificial intelligence, uses computer algorithms that automatically improve through experience. In this context, ML tools could efficiently model the complexity of and interactions between multiple patient behaviors that lead to medication adherence. This study aimed to create and validate a PROM on medication adherence interpreted using an ML approach. This cross-sectional, single-center, observational study was carried out a French teaching hospital between 2021 and 2022. Eligible patients must have had at least 1 long-term treatment, medication adherence evaluation other than a questionnaire, the ability to read or understand French, an age older than 18 years, and provided their nonopposition. Included adults responded to an initial version of the PROM composed of 11 items, each item being presented using a 4-point Likert scale. The initial set of items was obtained using a Delphi consensus process. Patients were classified as poorly, moderately, or highly adherent based on the results of a medication adherence assessment standard used in the daily practice of each outpatient unit. An ML-derived decision tree was built by combining the medication adherence status and PROM responses. Sensitivity, specificity, positive and negative predictive values (NPVs), and global accuracy of the final 5-item PROM were evaluated. We created an initial 11-item PROM with a 4-point Likert scale using the Delphi process. After item reduction, a decision tree derived from 218 patients including data obtained from the final 5-item PROM allowed patient classification into poorly, moderately, or highly adherent based on item responses. The psychometric properties were 78% (95% CI 40%-96%) sensitivity, 71% (95% CI 53%-85%) specificity, 41% (95% CI 19%-67%) positive predictive values, 93% (95% CI 74%-99%) NPV, and 70% (95% CI 55%-83%) accuracy. We developed a medication adherence tool based on ML with an excellent NPV. This could allow prioritization processes to avoid referring highly adherent patients to time- and resource-consuming interventions. The decision tree can be easily implemented in computerized prescriber order-entry systems and digital tools in smartphones. External validation of this tool in a study including a larger number of patients with diseases associated with low medication adherence is required to confirm its use in analyzing and assessing the complexity of medication adherence.