You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When saving a grid search object with the custom XGBRegressor class and objective function, the following does not work: joblib.dump(gs_obj, dir + '/' + 'custom_loss_cv_grid.pkl')
The custom objective function cannot be pickled since it is defined within a closure. Using dill instead of pickle solves the problem:
import dill as pickle
# Run grid search
gs_obj = GridSearchCV(..)
# Save grid search object
with open(dir + '/' + 'custom_loss_cv_grid.pkl', 'wb') as f:
pickle.dump(gs_obj, f)
Install with: pip install dill
The text was updated successfully, but these errors were encountered:
Currently, this is implemented in the CustomXGBoostRegressor class directly. In addition, to loading a pre-existing model/gridsearch. Eventually, when more models are added this feature should be part of a wrapper class (or something similar).
When saving a grid search object with the custom XGBRegressor class and objective function, the following does not work:
joblib.dump(gs_obj, dir + '/' + 'custom_loss_cv_grid.pkl')
The custom objective function cannot be pickled since it is defined within a closure. Using dill instead of pickle solves the problem:
Install with:
pip install dill
The text was updated successfully, but these errors were encountered: