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

if forecast_length == 'self': #223

Closed
varsha003 opened this issue Jan 6, 2024 · 1 comment
Closed

if forecast_length == 'self': #223

varsha003 opened this issue Jan 6, 2024 · 1 comment

Comments

@varsha003
Copy link

I am trying to do prediction with the model train pickle file like inference script . i am getting error as
Lib\site-packages\autots\evaluator\auto_ts.py", line 2281, in predict
if forecast_length == 'self':
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\varsha.k\Documents\SRInt\myenv\Lib\site-packages\pandas\core\generic.py", line 1527, in nonzero
raise ValueError(
ValueError: The truth value of a DataFrame is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().

then if i tried adding in predict statement like predictions = loaded_model.predict(df, forecast_length=7*24) i am getting error as

TypeError: AutoTS.predict() got multiple values for argument 'forecast_length'.

@winedarksea
Copy link
Owner

I think the problem here is you are passing in df as an arg to predict (which it sees as a positional arg for forecast length).
It is understandable you are trying to use the sklearn style but because there are more options here for data import there is a separate function to do that, model.fit_data(df).
In fact, there is no need to pickle AutoTS, you can simple model.export_template("your_file.csv", n=1)

then on a new AutoTS class:

model = AutoTS(...args)
model.import_best_model("your_file.csv")
model.fit_data(df)
model.predict()

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

2 participants