Upload amazon_chronos-2_0.txt with huggingface_hub
Browse files- amazon_chronos-2_0.txt +25 -0
amazon_chronos-2_0.txt
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
```CODE:
|
| 2 |
+
import pandas as pd
|
| 3 |
+
from chronos import BaseChronosPipeline
|
| 4 |
+
|
| 5 |
+
pipeline = BaseChronosPipeline.from_pretrained("amazon/chronos-2", device_map="cuda")
|
| 6 |
+
|
| 7 |
+
# Load historical data
|
| 8 |
+
context_df = pd.read_csv("https://autogluon.s3.us-west-2.amazonaws.com/datasets/timeseries/misc/AirPassengers.csv")
|
| 9 |
+
|
| 10 |
+
# Generate predictions
|
| 11 |
+
pred_df = pipeline.predict_df(
|
| 12 |
+
context_df,
|
| 13 |
+
prediction_length=36, # Number of steps to forecast
|
| 14 |
+
quantile_levels=[0.1, 0.5, 0.9], # Quantiles for probabilistic forecast
|
| 15 |
+
id_column="item_id", # Column identifying different time series
|
| 16 |
+
timestamp_column="Month", # Column with datetime information
|
| 17 |
+
target="#Passengers", # Column(s) with time series values to predict
|
| 18 |
+
)
|
| 19 |
+
```
|
| 20 |
+
|
| 21 |
+
ERROR:
|
| 22 |
+
Traceback (most recent call last):
|
| 23 |
+
File "/tmp/amazon_chronos-2_0PMuQIb.py", line 16, in <module>
|
| 24 |
+
import pandas as pd
|
| 25 |
+
ModuleNotFoundError: No module named 'pandas'
|