1

I'm using scikit-learn 1.0.2 and the partial_dependence function (which should correspond one to one with the plot_partial_dependence) imported like this:

from sklearn.inspection import partial_dependence  

and I call it as follows in my code (same as in the documentation example):

out = partial_dependence(classifier, X_train, ['feature1'])

here out is a tuple containing the predictions and the grid values. I only care about the predictions. What is not clear to me is whether the out[0] or predictions are the fraction of the 'feature1' on the overall prediction OR it is the full prediction result. I also don't understand why the results are so different when switching between response_method='predict_proba' and response_method='decision_function' for example for a SVM binary classifier assuming the decision boundary is 50% I would expect these two to output similar values but the difference is huge.

Can anyone explain?

SkyWalker
  • 13,729
  • 18
  • 91
  • 187
  • 1
    Your second question might be related to what's described in https://stackoverflow.com/questions/68475534/svm-model-predicts-instances-with-probability-scores-greater-than-0-1default-th/70049005#70049005, namely the fact that on *binary*, *non probabilistic* classifiers like `SVC()` predictions obtained via `.decision_function()` and `.predict_proba()` do not necessarily correspond. – amiola Feb 19 '22 at 17:28

0 Answers0