I fitted a LGBMRegressor() model and even predicted some values. I decided to save it (after fit of course) to use later, but when I try to load the model I'm getting this exception:
Estimator not fitted, call fit before exploiting the model.
I tried to save in 3 different ways:
dump(model, 'model.txt')dump(model, 'model.pkl')dump(model, 'model.joblib')
Then I close the IDE and tried to load like this:
model = joblib.load('model.allExtensionsMentionedBefore')
When I print(model) I can see the entire model and also it's hyperparameters:
LGBMRegressor(colsample_bytree=0.9596645565436184,
learning_rate=0.025825537313443326, min_child_samples=72,
num_leaves=32, random_state=0, silent=True,
subsample=0.9311181768429686, subsample_freq=1)
However when I try model.predict(X) I'm getting the exception saying that it's not fitted.
What I am doing wrong?
PS: I was able to do to this exact process (save and load) using sklearn MLPRegressor() and it worked perfectly.