Skip to content

Instantly share code, notes, and snippets.

@joseph-allen
Created April 26, 2019 16:05
Show Gist options
  • Select an option

  • Save joseph-allen/d138f5900a7cd014b71aa34c2d2a5146 to your computer and use it in GitHub Desktop.

Select an option

Save joseph-allen/d138f5900a7cd014b71aa34c2d2a5146 to your computer and use it in GitHub Desktop.

Revisions

  1. joseph-allen created this gist Apr 26, 2019.
    13 changes: 13 additions & 0 deletions load_pickle.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    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)