> ## Documentation Index
> Fetch the complete documentation index at: https://nixtlaverse.nixtla.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Predicting a subset of ids

> Compute predictions for only a subset of the training ids

```python theme={null}
from lightgbm import LGBMRegressor
from fastcore.test import test_fail

from mlforecast import MLForecast
from mlforecast.utils import generate_daily_series
```

```python theme={null}
series = generate_daily_series(5)
fcst = MLForecast({'lgb': LGBMRegressor(verbosity=-1)}, freq='D', date_features=['dayofweek'])
fcst.fit(series)
all_preds = fcst.predict(1)
all_preds
```

|   | unique\_id | ds         | lgb      |
| - | ---------- | ---------- | -------- |
| 0 | id\_0      | 2000-08-10 | 3.728396 |
| 1 | id\_1      | 2000-04-07 | 4.749133 |
| 2 | id\_2      | 2000-06-16 | 4.749133 |
| 3 | id\_3      | 2000-08-30 | 2.758949 |
| 4 | id\_4      | 2001-01-08 | 3.331394 |

By default all series seen during training will be forecasted with the
predict method. If you’re only interested in predicting a couple of them
you can use the `ids` argument.

```python theme={null}
fcst.predict(1, ids=['id_0', 'id_4'])
```

|   | unique\_id | ds         | lgb      |
| - | ---------- | ---------- | -------- |
| 0 | id\_0      | 2000-08-10 | 3.728396 |
| 1 | id\_4      | 2001-01-08 | 3.331394 |

Note that the ids must’ve been seen during training, if you try to
predict an id that wasn’t there you’ll get an error.

```python theme={null}
test_fail(lambda: fcst.predict(1, ids=['fake_id']), contains='fake_id')
```
