Skip to content

Instantly share code, notes, and snippets.

@joseph-allen
Created April 26, 2019 16:05
Show Gist options
  • Save joseph-allen/d138f5900a7cd014b71aa34c2d2a5146 to your computer and use it in GitHub Desktop.
Save joseph-allen/d138f5900a7cd014b71aa34c2d2a5146 to your computer and use it in GitHub Desktop.
Demo of loading a pickle
import pickle
import pandas as pd
import numpy as np
# Create sample data
df = pd.DataFrame(columns=['A','B','C'])
df.loc[0] = [12,42,'test']
# load stored model
loaded_model = pickle.load(open('Pickled_Model.pkl', 'rb'))
result = loaded_model.predict(df)
print(result)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment