Created
September 25, 2017 07:23
-
-
Save mainyaa/316a5533174faf1fadf75e19dc93b73b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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