Views
No views yet
| Metric | Value |
|---|---|
| mse | 1.0823 |
| mae | 0.8172 |
| mape | 16552.9256 |
1# Import the Chronos pipeline
2# Note: You may need to adjust the import path based on your installation
3import sys
4sys.path.append('/path/to/chronos-forecasting/src') # Adjust this path
5from chronos.chronos import ChronosPipeline
6import torch
7
8# Load the model
9pipeline = ChronosPipeline.from_pretrained("mainmagic/chronos-t5-small-btc-m1")
10
11# Create input data (example)
12context = torch.randn(1, 512) # Batch size 1, context length 512
13
14# Generate forecast
15forecast = pipeline.predict(
16 context,
17 prediction_length=60, # Predict 60 steps ahead
18 num_samples=20 # Generate 20 different forecast trajectories
19)
20
21# Use median as point forecast
22median_forecast = torch.median(forecast, dim=1)[0]1@misc{chronos-forecasting,
2 author = {Amazon Science},
3 title = {Chronos: Learning the Language of Time Series},
4 year = {2024},
5 publisher = {GitHub},
6 journal = {GitHub repository},
7 howpublished = {\url{https://github.com/amazon-science/chronos-forecasting}}
8}