Skip to content

Support for scikit neural networks and renaming omlt.onnx.py#62

Open
joshuahaddad wants to merge 17 commits intocog-imperial:mainfrom
joshuahaddad:sklearn-reader
Open

Support for scikit neural networks and renaming omlt.onnx.py#62
joshuahaddad wants to merge 17 commits intocog-imperial:mainfrom
joshuahaddad:sklearn-reader

Conversation

@joshuahaddad
Copy link
Copy Markdown
Collaborator

This code adds an interface for scikit learn MLPRegressor() objects via the sklearn2onnx library and support for scikit offset scaling objects. All scikit scaling objects which do linear scaling are supported including StandardScaler, MaxAbsScaler, MinMaxScaler, and RobustScaler.

Some changes were required to the onnx_parser to handle the different conventions created by sklearn2onnx such as the biases being stored as (1, n) matrices instead of (n,) vectors.

Additionally, since sklearn_reader.py imports the omlt onnx reader it was renamed to onnx_reader.py instead of onnx.py as this leads to a circular import issue since the naming omlt.onnx.py conflicts with the global onnx library.

@joshuahaddad joshuahaddad requested a review from jalving February 22, 2022 03:31
@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 22, 2022

Codecov Report

❌ Patch coverage is 93.18182% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.10%. Comparing base (683caa7) to head (83f96bc).
⚠️ Report is 242 commits behind head on main.

Files with missing lines Patch % Lines
src/omlt/io/sklearn_reader.py 92.10% 1 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #62      +/-   ##
==========================================
- Coverage   94.15%   94.10%   -0.05%     
==========================================
  Files          24       25       +1     
  Lines        1231     1272      +41     
  Branches      186      192       +6     
==========================================
+ Hits         1159     1197      +38     
- Misses         42       43       +1     
- Partials       30       32       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant