mlforecast icon indicating copy to clipboard operation
mlforecast copied to clipboard

Kernel crashes on fit()

Open benhorvath opened this issue 7 months ago • 0 comments

What happened + What you expected to happen

I am unable to get the basic script in the repo README to work. In JupyterLab running in VS Studio, the kernel instantly crashes at fit(). I have also tried with other example notebooks, with the same problem. Running the code straight in the terminal also crashes the interpreter.

I have verified via Activity Monitor that neither CPU load or memory consumption behave oddly when I run fit().

I am operating within a new virtualenv environment on Python 3.12.3, with mlforecast==0.13.1. The Macbook Pro is fairly new (Nov. 2023), with M3 Pro chips, Mac OS Sonoma 14.3.1.

EDIT: The fit() does NOT crash when only sklearn models are used, like Ridge(), Lasso(), or LinearRegression(). It DOES crash when using lgb or xgboost.

Versions / Dependencies

mlforecast==0.13.1 python==3.12.3 lightgbm==4.4.0 scikit-learn==1.5.1

Reproduction script

from mlforecast.utils import generate_daily_series

series = generate_daily_series( n_series=20, max_length=100, n_static_features=1, static_as_categorical=False, with_trend=True ) series.head()

import lightgbm as lgb from sklearn.linear_model import LinearRegression

models = [ lgb.LGBMRegressor(random_state=0, verbosity=-1), LinearRegression(), ]

from mlforecast import MLForecast from mlforecast.lag_transforms import ExpandingMean, RollingMean from mlforecast.target_transforms import Differences

fcst = MLForecast( models=models, freq='D', lags=[7, 14], lag_transforms={ 1: [ExpandingMean()], 7: [RollingMean(window_size=28)] }, date_features=['dayofweek'], target_transforms=[Differences([1])], )

fcst.fit(series)

The Kernel crashed while executing code in the current cell or a previous cell.

Issue Severity

High: It blocks me from completing my task.

benhorvath avatar Jul 06 '24 00:07 benhorvath