How to use kneighbors function on joblib loaded model

23 Views Asked by At

I am trying to use joblib to import a trained model and without having to train it again.

I tried this code:

filename = "Nearest_neighbors_model.pkl"

loaded_model = joblib.load(filename)
for x in (loaded_model.kneighbors([df.iloc[random(range(0,df.__len__()))]],n_neighbors= 50,  return_distance=False))[0]:
    print(lookupdata.iloc[x])

But I keep getting a

TypeError: 'module' object is not callable
0

There are 0 best solutions below