1

I have a pickled model file on my desktop on Mac. I want to load it to my Jupyter notebook. However, when I try this code:

import pickle
file_1 = open('RFonevsrest2_model.sav', 'r')
loaded_model = pickle.load(file_1)

I get an error saying there is No such file or directory. I do not know how to get the file inside my working directory or access is from local. Please help.

N Chauhan
  • 3,407
  • 2
  • 7
  • 21
sayo
  • 207
  • 4
  • 18

1 Answers1

0

Specifying the path where the model resides and then using Joblib to access it does the trick:

RFmodel=open("/Users/sayontimondal/Desktop/RFonevsrest2_model.sav") loaded_model = joblib.load(RFmodel)

sayo
  • 207
  • 4
  • 18