Skip to content

Instantly share code, notes, and snippets.

@mainyaa
Created September 25, 2017 07:23
Show Gist options
  • Save mainyaa/316a5533174faf1fadf75e19dc93b73b to your computer and use it in GitHub Desktop.
Save mainyaa/316a5533174faf1fadf75e19dc93b73b to your computer and use it in GitHub Desktop.
from sklearn.externals import joblib
def save_model(model, name):
'''
saves trained model
'''
joblib.dump(model, name)
def load_model(name):
'''
loads pretrained model
'''
return joblib.load(name)
model, pred, pred_proba = create_test_model(lg,
x_tr, y_tr, x_te, y_te)
save_model(model, "xgb_model_c_{}.pkl".format(i))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment