Get probability score from joblib classifier

Viewed 8

I am trying to use the joblib python library to load and test a classifier model which has been trained and saved in pkl file. The model is loaded correctly and using the predict method I am able to know the predicted class of each input entry.

model = joblib.load("classifier.pkl")
df_text = pd.DataFrame({'Text':df['Text']})
df['prediction'] = model.predict(df_text)

I need to know which score the model gives to every predicted class. I want to know if the model is telling that input x must be classified in class y, how much the model is certain of its classification.

Is there any method that can give the probability score that the model use in its predictions?

1 Answers

As the classifier model is generated by Azure AutoML, I found the method predict_proba(x), that works for all types of classifiers

Related