Added Onnx Export to PlattCalibratorTransformer#4699
Merged
antoniovs1029 merged 10 commits intodotnet:masterfrom Jan 27, 2020
Merged
Added Onnx Export to PlattCalibratorTransformer#4699antoniovs1029 merged 10 commits intodotnet:masterfrom
antoniovs1029 merged 10 commits intodotnet:masterfrom
Conversation
Contributor
Author
|
By the way, I tried to add more tests using the optional parameters of the PlattCalibratorEstimator, such as scoreColumnName, but it seems that API is broken. I've opened issue #4700 about this. If that issue gets fixed, then it would be a good idea to add more OnnxConversion tests to cover those cases and see if the onnx conversion still works when using "non-default" names. |
harishsk
reviewed
Jan 24, 2020
| Done(); | ||
| } | ||
|
|
||
| [Fact] |
Contributor
There was a problem hiding this comment.
This shouldn't be part of your changes. Maybe you did your merge steps wrong?
Contributor
Author
There was a problem hiding this comment.
Yeah, I think I messed up, but it's fixed now
kere-nel
reviewed
Jan 25, 2020
Codecov Report
@@ Coverage Diff @@
## master #4699 +/- ##
=========================================
Coverage ? 75.86%
=========================================
Files ? 951
Lines ? 172526
Branches ? 18629
=========================================
Hits ? 130886
Misses ? 36464
Partials ? 5176
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PlattCalibratoralready had aSaveAsOnnxmethod (link) which was called when saving to Onnx aPlattCalibratorthrough aCalibratedModelParameterclass (such as in here). This would happen when saving a model produced by a calibrated binary classifier.Besides being part of calibrated binary classifiers, a PlattCalibrator can also be used independently, through a
PlattCalibratorTransformer. So in this PR I add the necessary code so to also make it possible to save as Onnx a model that used aPlattCalibratorTransformer.I added 2 tests where a PlattCalibratorTransformer is added at the end of the model (in one test it's added on top of binary classifiers, in the other test no binary classifiers were used).
I also fixed a bug in the SaveAsOnnx method of PlattCalibrator. For some reason, it was hardcoded to use "-0.0000001f" as the value of the Offset, ignoring the actual offset that the calibrator had. This worked with the existing tests because in them the offset was actually "0", but that isn't always the case, and so in the tests that I am adding the offset is not 0.