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?