Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save GabrielSGoncalves/96b0252e0c3935426d52561c01c6f614 to your computer and use it in GitHub Desktop.
Save GabrielSGoncalves/96b0252e0c3935426d52561c01c6f614 to your computer and use it in GitHub Desktop.
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