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

AttributeError: 'TimesFm' object has no attribute 'forecast_with_covariates' #122

Open
algomaschine opened this issue Aug 12, 2024 · 0 comments

Comments

@algomaschine
Copy link

Guys, I've installed a latest experimental version of TimesFm, here're are the conda specs:

name: tfm2

channels:

I create this conda under wsl (ubuntu). The creation is successful, the package timefm is also installed by pip correctly.
Then I run jupyter notebook from within virtual machine and open this file downloaded locally https://github.com/google-research/timesfm/blob/master/notebooks/covariates.ipynb, but apparently the latest version of package doesn't see some api functions to be implemented.


AttributeError Traceback (most recent call last)
Cell In[13], line 16
13 start_time = time.time()
14 # Forecast with covariates
15 # Output: new forecast, forecast by the xreg
---> 16 cov_forecast, ols_forecast = model.forecast_with_covariates(
17 inputs=example["inputs"],
18 dynamic_numerical_covariates={
19 "gen_forecast": example["gen_forecast"],
20 },
21 dynamic_categorical_covariates={
22 "week_day": example["week_day"],
23 },
24 static_numerical_covariates={},
25 static_categorical_covariates={
26 "country": example["country"]
27 },
28 freq=[0] * len(example["inputs"]),
29 xreg_mode="xreg + timesfm", # default
30 ridge=0.0,
31 force_on_cpu=False,
32 normalize_xreg_target_per_input=True, # default
33 )
34 print(
35 f"\rFinished batch {i} linear in {time.time() - start_time} seconds",
36 end="",
37 )
38 metrics["eval_mae_timesfm"].extend(
39 mae(raw_forecast[:, :horizon_len], example["outputs"])
40 )

AttributeError: 'TimesFm' object has no attribute 'forecast_with_covariates'

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