iamDecode / sklearn-pmml-model

A library to parse and convert PMML models into Scikit-learn estimators.
BSD 2-Clause "Simplified" License
76 stars 15 forks source link

Support classification with linear models #24

Closed iamDecode closed 3 years ago

iamDecode commented 3 years ago

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[bot] commented 3 years ago

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.