3.1. Evaluation of the Performance of ML Models
We evaluated fourteen regression algorithms to forecast daily MSW generation by fraction (organic and inorganic). Predictors combine calendar descriptors, short-horizon memory terms computed from the rate series (lags and 7-day rolling statistics), and an operational denominator by generator category (persons or premises). Performance was assessed with daily expanding-window backtesting to preserve temporal causality, training on past observations and testing on the next day. Final metrics are computed over pooled OOS predictions from 13 one-day test blocks (52 observations).
To quantify statistical uncertainty under the short time horizon and within-day dependence, we report 95% confidence intervals using a day-cluster bootstrap over pooled out-of-sample predictions (resampling test days). Intervals are computed in rate space. These uncertainty estimates are summarized in
Table 6.
Figure 4 shows observed versus predicted values in kilograms after inverting the target transformation (
). Most models concentrate near the identity line, with tighter dispersion for the inorganic fraction. The plots also reveal systematic degradation for SVR, MLPRegressor, and the penalized linear models, which exhibit larger deviations and, in some cases, clear bias away from the identity line. This visual pattern is consistent with the test metrics in
Table 7 and
Table 8, which are reported in rate space.
Across candidates, the best generalization is obtained with tree-based ensembles and strong linear benchmarks. For the organic fraction (
Table 7), AdaBoost achieves the lowest test error (
,
,
), followed closely by Random Forest (
,
,
) and the remaining top ensembles (Gradient Boosting, Extra Trees) and Linear Regression, all with
and
below
. For the inorganic fraction (
Table 8), Random Forest provides the best overall performance (
,
,
), with Ridge, Extra Trees, and Gradient Boosting showing very similar accuracy. These results indicate that, within this dataset, short-horizon autoregressive structure and denominator-driven scaling are highly informative, and flexible ensembles can exploit them reliably under temporal evaluation.
To address concerns about whether high values simply reflect a strong autoregressive baseline, we also report pseudo- relative to a lag-7 persistence benchmark. In the organic fraction, several models improve over lag-7 persistence (e.g., AdaBoost pseudo- ; Linear Regression ; Random Forest ), while others are close to parity or slightly worse (e.g., Gradient Boosting ). In the inorganic fraction, improvements over lag-7 persistence are smaller but still present for key ensembles (e.g., Extra Trees ; Random Forest ). This comparison supports that the best-performing models provide predictive skill beyond naive weekly repetition, though gains are fraction-dependent and modest in some cases.
In addition to lag-7 persistence, ARIMA provides a complementary autoregressive benchmark in rate space, achieving , , and for the organic fraction and , , and for the inorganic fraction; these values remain below the best ML models, supporting the added value of the proposed pipelines.
Methods that are sensitive to scaling and local neighborhoods (KNN, SVR, and MLPRegressor) show a clear loss of accuracy under backtesting, and the penalized linear models (Lasso and ElasticNet) fail to recover stable coefficients in this short, heterogeneous setting, yielding near-zero or negative and strongly negative pseudo-.
The results support tree-based ensembles as the most reliable family under temporal backtesting, with AdaBoost leading in the organic fraction (
,
) and Random Forest leading in the inorganic fraction (
,
). This behavior is consistent with municipal MSW settings where generator heterogeneity and short-horizon dynamics create nonlinear effects that are well captured by ensemble models [
25,
26]. At the same time, the organic fraction shows several near-ties (e.g., Linear Regression and the top ensembles), indicating that the engineered autoregressive and denominator features explain most of the signal in that series. Finally, using multiple metrics (
,
,
,
) together with baseline-relative skill (pseudo-
vs. lag-7) enables a more robust comparison and avoids over-reliance on a single goodness-of-fit statistic under a limited time horizon [
27,
28].
3.2. Temporal Representativeness and Generalization Limits
This study relies on a short observational window. With a limited number of unique days, the evaluation is exposed to higher uncertainty and a higher risk of overfitting, especially given the number of candidate models, the hyperparameter tuning procedure, and the engineered feature set (calendar encodings, lags, and moving averages). In this setting, high goodness-of-fit values can be inflated by strong short-term persistence and by the limited diversity of temporal conditions covered.
We mitigate these risks with strict temporal backtesting. We use daily expanding-window one-step-ahead evaluation and fit all preprocessing steps only on the training block of each split to prevent leakage. We also benchmark against strong autoregressive baselines, including lag-7 persistence, and we quantify uncertainty with day-cluster bootstrap confidence intervals for and based on pooled out-of-sample predictions. These steps provide a more conservative estimate of performance than a single hold-out split.
Despite these controls, the current window does not cover longer seasonal cycles or broader operational variation. Therefore, stability across seasons cannot be claimed. In addition, the analysis is limited to one municipality and a fixed operational context. Generalization to other cities requires external validation under different demographic, climatic, and service conditions, and periodic re-calibration when deployed.
3.3. Loss Curves and Error Diagnostics of the Selected Models
To complement the aggregate metrics in
Table 7 and
Table 8, we report diagnostic curves and point-wise error profiles for the selected models in each fraction.
Figure 5 shows training and validation
curves in kilograms under the same temporal backtesting protocol used for model evaluation. For the organic fraction, AdaBoost reaches its lowest validation
early (around
) and then stabilizes, indicating that additional estimators do not improve generalization. For the inorganic fraction, Random Forest attains its best validation
within the evaluated grid at a larger ensemble size (around
), with stable training loss and a relatively flat validation profile after the initial decrease. These diagnostics support the model selection reported in
Table 7 and
Table 8 and highlight that the two fractions require different ensemble capacities.
Figure 6 presents point-wise predictions and prediction errors in kilograms across the pooled out-of-sample evaluations. The inorganic fraction shows smaller dispersion and smaller error magnitudes across models, while the organic fraction exhibits larger deviations around high-generation days. This pattern is visible even for the strongest models and is consistent with the higher sensitivity of organic waste to unobserved external drivers and operational variability. In contrast, weak baselines for this dataset (Lasso, ElasticNet, and MLPRegressor) show large systematic errors, confirming their limited suitability under the temporal protocol.
Overall, the diagnostic evidence confirms two stable behaviors: (i) inorganic waste is more predictable and yields smaller errors; and (ii) organic waste concentrates larger errors during peaks. These peak deviations suggest that incorporating exogenous variables (e.g., rainfall, holidays, local events, and operational disruptions) could further reduce organic errors, particularly during atypical days. Consistent with
Table 7 and
Table 8, the selected models remain AdaBoost for organic and Random Forest for inorganic, with other tree ensembles providing competitive performance within a narrow margin.
3.4. Feature Importance Analysis
Figure 7 summarizes global feature importance using SHAP for the selected models in each fraction, computed in the log-rate target space. For the organic fraction (top panel), generator-category indicators dominate the explanation, led by
Fuente_vivienda and the two market indicators (
Fuente_mercado 1 and
Fuente_mercado 2). Denominator history (
denom_ma7,
denom_lag1) also ranks among the most influential predictors, confirming that source scale (persons/premises) and its short-term variation shape the expected organic rate. Short-horizon memory terms from both fractions (
y_org_lag1,
y_org_ma7,
y_inorg_lag1,
y_inorg_ma7,
y_org_lag7,
y_inorg_lag7) appear next, indicating that organic predictions are largely driven by recent autoregressive structure and cross-fraction co-movement in the engineered lags.
For the inorganic fraction (bottom panel), Fuente_establecimientos and Fuente_vivienda are the strongest drivers, followed by market indicators and denominator terms (denom_lag1, denom_ma7). Lagged inorganic and organic signals (y_inorg_lag1, y_inorg_ma7, y_org_lag1, y_org_ma7) remain consistently relevant, supporting that the model leverages short-term persistence and cross-fraction information even when the two outputs are learned independently. Weekly calendar terms (semana_sin and semana_cos) appear with smaller but non-negligible effects, suggesting a mild weekly seasonal component beyond the explicit lag features.
Local LIME explanations on representative test instances (including organic peak days and typical low-error days) are consistent with the SHAP ranking. The dominant contributions are associated with generator category, recent lags and rolling statistics of the rate series, and denominator-related variables, while calendar terms play a secondary role. Together, SHAP and LIME indicate that the models rely on operationally meaningful signals (source type, short-term persistence, and scale effects) rather than arbitrary correlations. From an operational standpoint, these results emphasize the value of maintaining consistent daily records by generator category and keeping denominators (persons/premises) up to date. The remaining organic peak errors further motivate incorporating exogenous drivers (e.g., rainfall, holidays, local events, or service disruptions) in future extensions.
3.5. Environmental and Operational Aspects of MSW Modeling
The MSW characterization for La Joya de los Sachas estimates a total municipal solid waste generation of 14.54 t/day, with 67.46% organic waste (9.81 t/day) and 15.52% recyclable materials (2.26 t/day). This composition supports circular strategies such as composting, material recovery, and landfill bio gas utilization [
29].
Within this context, the forecasting errors of the selected models are small relative to the daily municipal flows. At city level, the mean absolute error is 246.62 kg/day for the organic fraction, 141.45 kg/day for the inorganic fraction, and 306.23 kg/day for total MSW (pooled out-of-sample predictions across temporal backtesting). These values represent approximately 2.51% of daily organic generation (246.62 kg over 9.81 t), 2.99% of daily inorganic generation (141.45 kg over ∼4.73 t), and 2.11% of total daily MSW (306.23 kg over 14.54 t). Assuming a typical compactor–truck capacity of 6000–8000 kg, the total absolute error corresponds to roughly 3.8–5.1% of one truck load per day, well below a full trip.
In addition, the selected models reduce error substantially relative to the lag-7 persistence baseline in operational units. Compared with the baseline, decreases from 453.20 to 246.62 kg/day for organic waste, from 313.00 to 141.45 kg/day for inorganic waste, and from 612.71 to 306.23 kg/day for total MSW. This improvement indicates that the forecasting pipeline adds practical value beyond naive weekly repetition when predictions are interpreted at the city scale.
Operationally, this uncertainty level lies within typical safety margins used in fleet sizing and collection scheduling. The forecasts are therefore suitable to support day-ahead decisions on vehicle allocation, route planning, and frequency adjustments without compromising service reliability. Environmentally, aligning predictions with observed variability reduces systematic over/underestimation, helps avoid unnecessary trips, and improves planning of organic-rich streams for composting or bio gas recovery.