To identify and rank the importance of key determinants of end-of-life (EOL) health care costs, and to understand how the key factors impact different percentiles of the distribution of health care costs. We applied a principled, machine learning-based variable selection algorithm, using Quantile Regression Forests, to identify key determinants for predicting the 10th (low), 50th (median), and 90th (high) quantiles of EOL health care costs, including costs paid for by Medicare, Medicaid, Medicare Health Maintenance Organizations (HMOs), private HMOs, and patient's out-of-pocket expenditures. Our sample included 7 539 Medicare beneficiaries who died between 2002 and 2017. The 10th, 50th, and 90th quantiles of EOL health care cost are $5 244, $35 466, and $87 241, respectively. Regional characteristics, specifically, the EOL-Expenditure Index, a measure for regional variation in Medicare spending driven by physician practice, and the number of total specialists in the hospital referral region were the top 2 influential determinants for predicting the 50th and 90th quantiles of EOL costs but were not determinants of the 10th quantile. Black race and Hispanic ethnicity were associated with lower EOL health care costs among decedents with lower total EOL health care costs but were associated with higher costs among decedents with the highest total EOL health care costs. Factors associated with EOL health care costs varied across different percentiles of the cost distribution. Regional characteristics and decedent race/ethnicity exemplified factors that did not impact EOL costs uniformly across its distribution, suggesting the need to use a "higher-resolution" analysis for examining the association between risk factors and health care costs.