Explainable Artificial Intelligence (XAI) has gained increasing importance as modern machine learning models operate as opaque black-box systems, limiting transparency and trust in automated decision-making. While most XAI frameworks merely focus on static post-hoc visualizations, this study goes beyond passive diagnostics by introducing an algorithmic recourse framework for income prediction. By integrating SHAP (SHapley Additive exPlanations) with an optimized Random Forest classifier trained on the UCI Adult Income dataset, we partition socio-economic attributes into actionable features (e.g., weekly working hours, education level) and immutable demographic variables (e.g., age, sex). The dataset was preprocessed using missing-value handling, categorical encoding, class balancing via SMOTE, and feature scaling. Hyperparameter tuning optimization determined that the configuration of 150 trees, a maximum depth of 15, and a minimum split size of 15 yielded peak training accuracy rates of 85.49%, 86.13%, and 86.05% respectively. The Random Forest model achieved strong predictive performance, yielding an accuracy of 84.68%, precision of 85.15%, recall of 84.68%, F1-score of 84.88%, and a high ROC-AUC of 90.95%. Global SHAP analysis identified relationship, marital status, and education as the primary drivers of income classification. Crucially, local instance-level counterfactual optimization demonstrates that strategically adjusting actionable features can successfully neutralize negative SHAP momentum and flip unfavorable low-income predictions (≤ 50K) into positive outcomes (>50K) while holding immutable traits perfectly constant. This integration demonstrates that combining Random Forest with an algorithmic recourse pipeline transforms AI from a descriptive transparency tool into an active, prescriptive mechanism that empowers data-driven decision-making and human solutions in socio-economic applications.
Copyrights © 2026