Skip to content

PMMLLogisticRegression does not work with predict_proba (support CutTransformer) #47

@KeenCat

Description

@KeenCat

Description

Hello, Thank you for amazing library faster than pypmml!
My logistic model is ('model', LogisticRegression(random_state=0, solver='liblinear').
So, I hope to use PMMLLogisticRegression for getting probability of target '1'.
I think result of using predict_proba(xx) is list of probability (0~1) value.
However, those result values are classification labels like [0, 1, 0, 0, 1].

Could I know how can I get probability of logistic regression?

Thank you.

Steps/Code to Reproduce

from sklearn_pmml_model.linear_model import PMMLLogisticRegression, PMMLRidgeClassifier, PMMLLinearRegression
model = PMMLLogisticRegression(pmml="./pmml/blahblah.pmml")
model.predict_proba(test)

Expected Results

[0.324234, 0.235365, 0.86786655, 0.435345, 0.3463654]

Actual Results

array([[1., 0.],
[0., 1.],
[0., 1.],
[0., 1.],
[1., 0.]])

Versions

Linux-4.19.157-1.20201118.el7.x86_64-x86_64-with-centos-7.8.2003-Core
Python 3.6.15 | packaged by conda-forge | (default, Dec 3 2021, 18:49:41)
[GCC 9.4.0]
NumPy 1.19.4
SciPy 1.5.4
Scikit-Learn 0.23.2
sklearn-pmml-model 1.0.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions