Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] TimeSeriesSplit to use auto-sklearn for time series doesn't work #1709

Open
samuelverdaasdonk opened this issue Dec 6, 2023 · 0 comments

Comments

@samuelverdaasdonk
Copy link

I want to use Auto-Sklearn for time series prediction. From what I understand from issue #501 , is that one should use resampling_strategy = sklearn.model_selection.TimeSeriesSplit in the AutoSklearnClassifier(). However, I have to use the AutoSklearnRegresor(). When I try to pass the TimeSeriesSplit argumument into this I get this error: ValueError: Illegal resampling strategy: <class 'sklearn.model_selection._split.TimeSeriesSplit'>.

For reference, I use this simple code (part of a rolling window):

X_train = X[:17835]
y_train = y[:17835]

X_test = X[17835:19628]
y_test = y[17835:19628]

automl = AutoSklearnRegressor(resampling_strategy=sklearn.model_selection.TimeSeriesSplit)
automl.fit(X_train, y_train)
preds = automl.predict(X_test)

results in:

[ERROR] [2023-12-06 12:20:54,725:Client-AutoML(1):81694fc2-9429-11ee-9d15-3f0b37f0904e] Illegal resampling strategy: <class 'sklearn.model_selection._split.TimeSeriesSplit'>
Traceback (most recent call last):
  File "/home/sverdaasdonk/Ubuntu/env_with_python3.7/lib/python3.7/site-packages/autosklearn/automl.py", line 694, in fit
    task=self._task,
  File "/home/sverdaasdonk/Ubuntu/env_with_python3.7/lib/python3.7/site-packages/autosklearn/automl.py", line 1112, in _check_resampling_strategy
    "Illegal resampling strategy: %s" % self._resampling_strategy
ValueError: Illegal resampling strategy: <class 'sklearn.model_selection._split.TimeSeriesSplit'>

Does anyone know if it is possible to use TimeSeriesSplit for AutoSklearnRegressor(), and/or to fix this error? Thanks in advance!
(I use Ubuntu and Auto-Sklearn 0.15.0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant