Fix log_training_metric crash for statistical time series models#1468
Closed
Copilot wants to merge 5 commits into
Closed
Fix log_training_metric crash for statistical time series models#1468Copilot wants to merge 5 commits into
Copilot wants to merge 5 commits into
Conversation
Skip training metric computation for ARIMA, SARIMAX, and Holt-Winters models when log_training_metric=True to avoid IndexError. These statistical models don't support in-sample predictions the same way ML models do. Co-authored-by: thinkall <3197038+thinkall@users.noreply.github.com>
Remove print statements and extract test data preparation to helper function Co-authored-by: thinkall <3197038+thinkall@users.noreply.github.com>
Co-authored-by: thinkall <3197038+thinkall@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix bug with log_training_metric causing time series models to fail
Fix log_training_metric crash for statistical time series models
Jan 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Statistical time series models (ARIMA, SARIMAX, Holt-Winters) fail with
IndexError: single positional indexer is out-of-boundswhenlog_training_metric=True.Root Cause
The
_eval_estimatorfunction attempts to compute training metrics by callingpredict()on training data. Statistical models use statsmodels' predict interface designed for out-of-sample forecasting—it requires timestamps and cannot handle in-sample predictions on training data like ML models.Changes
log_training_metric=TrueExample
Statistical models will log validation metrics but not training loss (which is less meaningful for models that fit the entire sequence). ML models continue computing training metrics normally.
Original prompt
This section details on the original issue you should resolve
<issue_title>[Bug]: Forecasting: log_training_metric causes arima, sarimax, holt-winters to fail when set to true.</issue_title>
<issue_description>### Describe the bug
The key findings are:
Individual TS estimators (arima, sarimax, holt-winters) FAIL with log_training_metric=True
ML estimators (xgboost, lgbm, catboost) PASS
When log_training_metric is NOT set, arima PASSES (see the holdout split test)
ROOT CAUSE HYPOTHESIS:
log_training_metric=Truecauses FLAML to call get_y_pred() on X_trainthe TS model's predict() method expects X to have timestamps, but during
internal validation, X_train can be empty or malformed.
Steps to reproduce
Script for reproduction