-
Hi! I'm experimenting with multi-step direct forecasting. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hey @laxhammar, thanks for using mlforecast. It's possible to use from mlforecast import MLForecast
from mlforecast.utils import generate_series
from sklearn.linear_model import LinearRegression
series = generate_series(5)
fcst = MLForecast(
models=[LinearRegression()],
freq='D',
lags=[1],
)
X, y = fcst.preprocess(series, max_horizon=4, return_X_y=True)
fcst.fit_models(X, y)
assert len(fcst.models_['LinearRegression']) == 4 |
Beta Was this translation helpful? Give feedback.
Hey @laxhammar, thanks for using mlforecast. It's possible to use
MLForecast.fit_models
, that method checks if the target is a matrix and if it is it trains one model for each column. Here's a minimal example: