I can't run the example from the readme. #362
Replies: 4 comments 2 replies
-
|
Can you check which version of the package is installed in your local environment? For example, using |
Beta Was this translation helpful? Give feedback.
-
|
chronos==0.3 |
Beta Was this translation helpful? Give feedback.
-
error: version python 3.13... |
Beta Was this translation helpful? Give feedback.
-
|
incompatibility with newer versions of Python? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I would be very grateful for your help, Import does not work even though the package is installed locally:
C:\Users\Cargo\AppData\Local\Programs\Python\Python313\python.exe C:\Users\Cargo\Desktop\stock\forecast_price.py
Traceback (most recent call last):
File "C:\Users\Cargo\Desktop\stock\forecast_price.py", line 9, in
from chronos import BaseChronosPipeline, Chronos2Pipeline
ImportError: cannot import name 'BaseChronosPipeline' from 'chronos' (C:\Users\Cargo\AppData\Local\Programs\Python\Python313\Lib\site-packages\chronos_init_.py)
example code: https://github.com/amazon-science/chronos-forecasting?tab=readme-ov-file#-usage
import pandas as pd # requires: pip install 'pandas[pyarrow]'
from chronos import Chronos2Pipeline
pipeline = Chronos2Pipeline.from_pretrained("amazon/chronos-2", device_map="cuda")
Load historical target values and past values of covariates
context_df = pd.read_parquet("https://autogluon.s3.amazonaws.com/datasets/timeseries/electricity_price/train.parquet")
(Optional) Load future values of covariates
test_df = pd.read_parquet("https://autogluon.s3.amazonaws.com/datasets/timeseries/electricity_price/test.parquet")
future_df = test_df.drop(columns="target")
Generate predictions with covariates
pred_df = pipeline.predict_df(
context_df,
future_df=future_df,
prediction_length=24, # Number of steps to forecast
quantile_levels=[0.1, 0.5, 0.9], # Quantile for probabilistic forecast
id_column="id", # Column identifying different time series
timestamp_column="timestamp", # Column with datetime information
target="target", # Column(s) with time series values to predict
)
Beta Was this translation helpful? Give feedback.
All reactions