Background & Aims: Population-level uptake of direct-acting antiviral (DAA) treatment for hepatitis C virus (HCV) infection, including retreatment, can be estimated through administrative pharmaceutical dispensation data. However, the reasons for retreatment are not captured in these data. We developed a machine learning model to classify retreatments as reinfection or treatment failure at a national level. Methods: Retreatment data from the REACH-C cohort (n = 10,843 treated with DAAs; n = 320 retreatments with known reason), were used to train a random forest model. Nested cross validation was undertaken to assess model performance and to optimise hyperparameters. The model was applied to data on DAA retreatment dispensed during 2016-2021 in Australia, to identify the reason for retreatment (treatment failure or reinfection). Results: Average predictive accuracy, precision, sensitivity, specificity and F1-score for the model were 96.3%, 96.5%, 96.3%, 96.3% and 96.3%, respectively. Nationally, 95,272 individuals initiated DAAs, with treatment uptake declining from 32,454 in 2016 to 6,566 in 2021. Of those treated, 6,980 (7%) were retreated. Our model classified 51.8% (95% CI 46.7-53.6%; n = 3,614) of cases as reinfection and 48.2% (95% CI 46.4-53.3%; n = 3,366) as treatment failure. Retreatment for reinfection increased steadily over the study period from 14 in 2016 to 1,092 in 2020, stabilising in 2021. Retreatment for treatment failure increased from 73 in 2016 to 1,077 in 2019, then declined to 515 in 2021. Among individuals retreated for treatment failure, 50% had discontinued initial treatment. Conclusions: We used a novel methodology with high classification accuracy to evaluate DAA retreatment patterns at a national level. Increases in retreatment uptake for treatment failure corresponded to the availability of pangenotypic and salvage regimens. Increasing retreatment uptake for reinfection likely reflects increasing reinfection incidence. (c) 2022 European Association for the Study of the Liver. Published by Elsevier B.V. All rights reserved.