Skip to content

Instantly share code, notes, and snippets.

@fuwiak
Created August 13, 2019 16:35
Show Gist options
  • Save fuwiak/2d9e056c2f637c4fd8843885c32b4324 to your computer and use it in GitHub Desktop.
Save fuwiak/2d9e056c2f637c4fd8843885c32b4324 to your computer and use it in GitHub Desktop.
#on yours computer
import pickle
from xgboost import XGBClassifier
from xgboost import Booster
clf = XGBClassifier()
booster = Booster()
booster.load_model('xgbsave_test.model')
clf._Booster = booster
pkl_filename = "pickle_model.pkl"
with open(pkl_filename, 'wb') as file:
pickle.dump(clf, file)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment