pyGAM icon indicating copy to clipboard operation
pyGAM copied to clipboard

predict_proba not consistent with sklearn

Open o1iv3r opened this issue 4 years ago • 2 comments

LogisticGAM.predict_proba() not consistent with sklearn since it does not return a two-dimensional array. I got around this issue by defining a new derived class:

class myGAM(LogisticGAM):
    def predict_proba(self, X):
        proba = self.predict_mu(X)
        pred_proba_sklearn_like = np.array([1 - proba, proba]).T
        return pred_proba_sklearn_like

Perhaps that can be changed in future versions of pyGAM

BTW: Great package, thanks for the development!

o1iv3r avatar Nov 04 '20 12:11 o1iv3r

+1, also encountered this; would be great to output [[proba_0, proba_1]...]

No-Stream avatar Jul 27 '21 00:07 No-Stream

Open PR here #213

miguelfmc avatar Aug 08 '22 05:08 miguelfmc