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

Added ONNX export support and tests for {FixedPlatt, Naive}CalibratorEstimators #5289

Merged
merged 13 commits into from
Jul 11, 2020

Conversation

mstfbl
Copy link
Contributor

@mstfbl mstfbl commented Jul 7, 2020

Partial Fix for #5277
Added ONNX export support for the Naive calibrator estimator. FixedPlatt calibrator estimator can already be exported as it is deriving from Platt calibrator, which is also already supported.

Also added unit tests to check ONNX export for FixedPlatt and Naive calibrator estimators. Specifically, I have consolidated the separate unit tests of calibrators with/without standard date and binary prediction trainers into 1 unit test per calibrator.

ONNX export support for IsotonicCalibratorEstimator will come in a separate PR.

@mstfbl mstfbl changed the title Added ONNX export support for {FixedPlatt, Isotonic, Naive}CalibratorEstimators Added ONNX export support and tests for {FixedPlatt, Naive}CalibratorEstimators Jul 9, 2020
@mstfbl mstfbl marked this pull request as ready for review July 9, 2020 19:28
@mstfbl mstfbl requested a review from a team as a code owner July 9, 2020 19:28
@codecov
Copy link

codecov bot commented Jul 9, 2020

Codecov Report

Merging #5289 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff            @@
##           master    #5289    +/-   ##
========================================
  Coverage   73.79%   73.80%            
========================================
  Files        1022     1022            
  Lines      190490   190617   +127     
  Branches    20484    20488     +4     
========================================
+ Hits       140571   140677   +106     
- Misses      44395    44418    +23     
+ Partials     5524     5522     -2     
Flag Coverage Δ
#Debug 73.80% <100.00%> (+<0.01%) ⬆️
#production 69.55% <100.00%> (+<0.01%) ⬆️
#test 87.66% <100.00%> (+0.01%) ⬆️
Impacted Files Coverage Δ
src/Microsoft.ML.Data/Data/SchemaDefinition.cs 71.79% <ø> (ø)
src/Microsoft.ML.Data/Prediction/Calibrator.cs 81.20% <100.00%> (+0.48%) ⬆️
test/Microsoft.ML.Tests/OnnxConversionTest.cs 96.68% <100.00%> (+0.10%) ⬆️
src/Microsoft.ML.Core/Data/ProgressReporter.cs 70.95% <0.00%> (-6.99%) ⬇️
...rosoft.ML.AutoML/ColumnInference/TextFileSample.cs 59.60% <0.00%> (-2.65%) ⬇️
src/Microsoft.ML.Maml/MAML.cs 23.78% <0.00%> (-1.46%) ⬇️
src/Microsoft.ML.FastTree/FastTree.cs 80.42% <0.00%> (-0.06%) ⬇️
...ML.Transforms/Text/StopWordsRemovingTransformer.cs 86.53% <0.00%> (+0.58%) ⬆️
src/Microsoft.ML.Data/TrainCatalog.cs 87.05% <0.00%> (+2.67%) ⬆️
... and 1 more

Copy link
Contributor

@harishsk harishsk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

{
// Initialize variables needed for the ONNX conversion test
var (mlContext, dataView, estimators, initialPipeline) = GetEstimatorsForOnnxConversionTests();

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, you might have just introduced a bug here. The mlContext returned from GetEstimatorsForOnnxConversionTests is now different from the MLContext used to create the calibrator. Either you should fix GetEstimatorsForOnnxConversionTests to use the MLContext from the base class or pass it in as a param to this function like I mentioned in my earlier comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the heads up, I have removed the usage of MLContext in these tests in lieu of ML.

@mstfbl
Copy link
Contributor Author

mstfbl commented Jul 11, 2020

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@mstfbl mstfbl merged commit fab2e1d into dotnet:master Jul 11, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Mar 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants