Predicting Pornography Use Among Adolescents in Spain: Findings from Ensemble Tree Models and Explainable Machine Learning
Jorge de Andrés-Sánchez, Ángel Belzunegui-Eraso, Inma Pastor-Gosálbez, Anna Sánchez-AragónPornography use during adolescence is a relevant issue from social, educational, and public health perspectives. As with other behaviours, its correlates may involve complex and nonlinear relationships. This study uses data from the 2023 Spanish Survey on Drug Use in Secondary Education (ESTUDES), a major source for analysing potentially addictive behaviours among adolescents in Spain because of its large sample size (original sample: N = 42,208; complete-case analytical sample: N = 33,543). Pornography use was modelled as a binary outcome using logistic regression, XGBoost, LightGBM, and CatBoost. The models included sociodemographic characteristics, family-related factors, parental control, substance use, selected sexual behaviours, indicators of mental well-being, and addictive Internet use. The four methods showed similar predictive performance. CatBoost achieved the highest AUC and the lowest Brier score and log loss, whereas LightGBM obtained the highest accuracy, specificity, and precision. Logistic regression yielded the highest sensitivity, negative predictive value, balanced accuracy, and F1-score. SHAP analysis identified sex as the most influential predictor, followed by addictive Internet use, cannabis and alcohol use, family conflict, and selected risky sexual behaviours. The findings suggest that pornography use among adolescents forms part of a broader behavioural and psychosocial profile. Whereas sex operated mainly as a strong direct predictor, problematic Internet use showed substantial interactions with age and cannabis and alcohol use. This study demonstrates how explainable machine learning can complement conventional regression by identifying the main correlates, nonlinear patterns, and interactions associated with adolescent pornography use.