Related Experiment Video
Updated: Jun 7, 2025

Integrating Computerized Linguistic and Social Network Analyses to Capture Addiction Recovery Capital in an Online Community
Published on: May 31, 2019
Use of Random Forest to Predict Adherence in an Online Intervention for Depression Using Baseline and Early Usage
Franziska Wenger1, Caroline Allenhof2, Simon Schreynemackers3
1Clinic for Psychiatry, Psychosomatics and Psychotherapy, University Hospital, Goethe University Frankfurt, Frankfurt am Main, Germany.
Background:
Online interventions, such as the iFightDepression (iFD) tool, are increasingly recognized as effective alternatives to traditional face-to-face psychotherapy or pharmacotherapy for treating depression. However, particularly when used outside of study settings, low adherence rates and the resulting diminished benefits of the intervention can limit their effectiveness. Understanding the factors that predict adherence would allow for early, tailored interventions for individuals at risk of nonadherence, thereby enhancing user engagement and optimizing therapeutic outcomes.
Objective:
This study aims to develop and evaluate a random forest model that predicts adherence to the iFD tool to identify users at risk of noncompletion. The model was based on characteristics collected during baseline and the first week of the intervention in patients with depression.
Methods:
Log data from 4187 adult patients who registered for the iFD tool between October 1, 2016, and May 5, 2022, and provided informed consent were statistically analyzed. The resulting data set was divided into training (2932/4187, 70%) and test (1255/4187, 30%) sets using a randomly stratified split. The training data set was utilized to train a random forest model aimed at predicting each user's adherence at baseline, based on the hypothesized predictors: age, self-reported gender, expectations of the intervention, current or previous depression treatments, confirmed diagnosis of depression, baseline 9-item Patient Health Questionnaire (PHQ-9) score, accompanying guide profession, and usage behavior within the first week. After training, the random forest model was evaluated on the test data set to assess its predictive performance. The importance of each variable in predicting adherence was analyzed using mean decrease accuracy, mean decrease Gini, and Shapley Additive Explanations values.
Results:
Of the 4187 patients evaluated, 1019 (24.34%) were classified as adherent based on our predefined definition. An initial random forest model that relied solely on sociodemographic and clinical predictors collected at baseline did not yield a statistically significant adherence prediction. However, after incorporating each patient's usage behavior during the first week, we achieved a significant prediction of adherence (P<.001). Within this prediction, the model achieved an accuracy of 0.82 (95% CI 0.79-0.84), an F1-score of 0.53, an area under the curve of 0.83, and a specificity of 0.94 for predicting nonadherent users. The key predictors of adherence included logs, word count on the first workshop's worksheet, and time spent on the tool, all measured during the first week.
Conclusions:
Our results highlight that early engagement, particularly usage behavior during the first week of the online intervention, is a far greater predictor of adherence than any sociodemographic or clinical factors. Therefore, analyzing usage behavior within the first week and identifying nonadherers through the algorithm could be beneficial for tailoring interventions aimed at improving user adherence. This could include follow-up calls or face-to-face discussions, optimizing resource utilization in the process.
More Related Videos
Related Concept Videos
Survival Tree
Building a Survival Tree
Constructing a...
Regression Toward the Mean
Prediction Intervals
However, the point estimate is most likely not the exact value of the population parameter, but close to it. After calculating point estimates, we construct interval estimates, called confidence intervals or prediction intervals. This prediction interval comprises a range of values unlike the point estimate and is a better predictor of the observed sample value, y.

