Created
March 16, 2021 03:31
-
-
Save GabrielSGoncalves/96b0252e0c3935426d52561c01c6f614 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
import pickle | |
# To pickle a Scorecard object | |
with open('scorecard_model.pickle', 'wb') as pfile: | |
pickle.dump(scorecard, pfile) | |
# To unpickle it | |
with open("scorecard_model.pickle", 'rb') as scorecard_pickle: | |
scorecard_production = pickle.load(scorecard_pickle) | |
# To use the Scorecard model for predictions in production | |
# For one sample | |
scorecard_production.score(df_application_test.iloc[0:1, :]) | |
# For a few samples | |
scorecard_production.score(df_application_test.iloc[0:3, :]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment