Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support classification with linear models #24

Merged
merged 1 commit into from May 26, 2021

Conversation

iamDecode
Copy link
Owner

@iamDecode iamDecode commented May 22, 2021

So far only linear regression was supported, but the step towards supporting logistic regression is trivial. This PR implements this.

There is unfortunately a bit of code duplication (PMMLLinearModel/PMMLLinearClassifier and PMMLGeneralizedLinearRegressor/PMMLGeneralizedLinearClassifier). Ideally PMMLLinearModel should be a generic class that can be either PMMLBaseRegressor or PMMLBaseClassifier. However, I was not able to use typing.Generic and also call super.__init__() on the generic class. This should be revisited later.

@codecov
Copy link

codecov bot commented May 22, 2021

Codecov Report

Merging #24 (04b9993) into master (bb2fc93) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #24   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           12        12           
  Lines          559       624   +65     
=========================================
+ Hits           559       624   +65     
Impacted Files Coverage Δ
sklearn_pmml_model/base.py 100.00% <100.00%> (ø)
sklearn_pmml_model/linear_model/__init__.py 100.00% <100.00%> (ø)
sklearn_pmml_model/linear_model/base.py 100.00% <100.00%> (ø)
sklearn_pmml_model/linear_model/implementations.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bb2fc93...04b9993. Read the comment docs.

This corresponds to the LogisticRegression and RidgeClassifier classes from sklearn.
@iamDecode iamDecode merged commit b0e5e55 into master May 26, 2021
@iamDecode iamDecode deleted the decode/glm-classifiers branch May 26, 2021 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant