# Quickstart

> A first forecast from NumPy, pandas or the command line.

Install the library, then make your first forecast. The first run downloads the model (42 MB) after the one-time
[license step](https://yhatlabs.com/models/docs/open-models/install#accept-the-license-once).

```bash
pip install yhatmodels
```

  **NumPy**

```python
import numpy as np
from yhatmodels import ChakraTS

model = ChakraTS.from_pretrained("ChakraTS-OS-10M")
history = 10 + np.sin(np.arange(500) / 24 * 2 * np.pi)  # or your own series
fc = model.forecast(history, h=48)
```

`fc` has shape `(48, 3)`: the 10%, 50% and 90% quantiles for each of the next 48 steps.
  
  **pandas**

```python
import numpy as np
import pandas as pd
from yhatmodels import ChakraTS

model = ChakraTS.from_pretrained("ChakraTS-OS-10M")

days = pd.date_range("2025-01-01", periods=200, freq="D")
df = pd.concat(
    pd.DataFrame({"unique_id": store, "ds": days, "y": 100 + 10 * np.sin(np.arange(200) / 7 * 2 * np.pi)})
    for store in ["store_1", "store_2"]
)
fc = model.forecast(df, h=7, level=[80, 95])
```

`fc` has one row per store and future day, with the columns `unique_id`, `ds`, `q2.5`, `q10`, `median`, `q90` and
`q97.5`: the median and the 80% and 95% intervals.
  
  **Command line**

```bash
yhatmodels forecast sales.csv --h 7 --level 80,95 -o forecast.csv
```

`sales.csv` has one row per series and date, with the columns `unique_id`, `ds` and `y`. `forecast.csv` gets one
row per series and future date, with the median and the intervals.
  

## Next

  - [Your data](https://yhatlabs.com/models/docs/open-models/data): Arrays and DataFrames: shapes, columns, missing values and frequency.
  - [Covariates](https://yhatlabs.com/models/docs/open-models/covariates): Use what you know about the future: prices, promotions, weather.
  - [Backtesting](https://yhatlabs.com/models/docs/open-models/backtesting): See how the model would have done on your own history.
  - [ChakraTS-OS-10M](https://yhatlabs.com/models/docs/open-models/chakrats-os-10m): Size, context, horizon, speed and benchmark results.
