IMPORTANCE Current approaches to predicting health care costs generally rely on a single composite value of spending and focus on short time horizons. By contrast, examining patients' spending patterns using dynamic measures applied over longer periods may better identify patients with different spending and help target interventions to those with the greatest need. OBJECTIVE To classify patients by their long-term, dynamic health care spending patterns using a data-driven approach and assess the ability to predict spending patterns, particularly using characteristics that are potentially modifiable through intervention. DESIGN, SETTING, AND PARTICIPANTS This cohort study used a retrospective cohort design from a random nationwide sample of Medicare fee-for-service administrative claims data to identify beneficiaries aged 65 years or older with continuous eligibility from 2011 to 2013. Statistical analysis was performed from August 2018 to December 2019. MAIN OUTCOMES AND MEASURES Group-based trajectory modeling was applied to the claims data to classify the Medicare beneficiaries by their total health care spending patterns over a 2-year period. The ability to predict membership in each trajectory spending group was assessed using generalized boosted regression, a data mining approach to model building and prediction, with splitsample validation. Models were estimated using (1) prior-year predictors and (2) prior-year predictors potentially modifiable through intervention measured in the claims data. These models were evaluated using validated C-statistics. The relative influence of individual predictors in the models was evaluated. RESULTS Among the 329 476 beneficiaries, the mean (SD) age was 76.0 (7.2) years and 190 346 (57.8%) were female. This final 5-group model included a minimal-user group (group 1, 37 572 individuals [11.4%]), a low-cost group (group 2, 48 575 individuals [14.7%]), a rising-cost group (group 3, 24 736 individuals [7.5%]), a moderate-cost group (group 4, 83 338 individuals [25.3%]), and a high-cost group (group 5, 135 255 individuals [41.2%]). Potentially modifiable characteristics strongly predicted these patterns (C-statistics range: 0.68-0.94). For groups with progressively increasing spending in particular, the most influential factors were number of medications (relative influence: 29.2), number of office visits (relative influence: 30.3), and mean medication adherence (relative influence: 33.6). CONCLUSIONS AND RELEVANCE Using a data-driven approach, distinct spending patterns were identified with high accuracy. The potentially modifiable predictors of membership in the rising-cost group represent important levers for early interventions that may prevent later spending increases. This approach could be adapted by organizations to target quality improvement interventions, (continued) Key Points Question What are the long-term spending patterns by Medicare beneficiaries, and do baseline patient factors that are potentially modifiable predict these patterns? Findings In this cohort st...