-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Adding functional tests for all training and evaluation tasks #2646
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
Adding functional tests for all training and evaluation tasks #2646
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2646 +/- ##
==========================================
+ Coverage 71.59% 71.69% +0.09%
==========================================
Files 805 808 +3
Lines 142004 142102 +98
Branches 16119 16115 -4
==========================================
+ Hits 101673 101879 +206
+ Misses 35891 35788 -103
+ Partials 4440 4435 -5
|
// Train the model. | ||
var model = pipeline.Fit(trainData); | ||
|
||
// Evaulate the model. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Evaulate [](start = 15, length = 8)
I think there is small typo that was copy pasted everywhere, can you fix that? #Resolved
/// </summary> | ||
/// <remarks> | ||
/// TODO #2644: At times, AnomalyDetection.Evaluate will return a set of NaN metrics. | ||
/// </remarks> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe would not add the TODO to a xml comment. I would suggest having it as a regular comment only. #Resolved
/// Check that a <see cref="BinaryClassificationMetrics"/> object is valid. | ||
/// </summary> | ||
/// <param name="metrics">The metrics object.</param> | ||
public static void CheckMetrics(BinaryClassificationMetrics metrics) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BinaryClassificationMetrics [](start = 40, length = 27)
we added CalibratedBinaryClassificationMetrics
recently. Strangely you don't have them in your PR. #Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once you fix the build and add the check and related test with CalibratedBinaryClassificationMetrics
it should be good to go.
This is a weird build error. When the build systems do it, it's not handling the method overloading correctly. I can't repro it locally.... |
var metrics = mlContext.BinaryClassification.Evaluate(scoredData); | ||
|
||
// Check that the metrics returned are valid. | ||
Common.CheckMetrics(metrics); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CheckMetrics [](start = 19, length = 12)
So the reason why I mentioned CalibratedBinaryClassificationMetrics
is not only to add them to Common.cs, but also to have test on them.
Maybe have two pipelines in this test. One with calibrated, one without.
#Resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{ | ||
output.Label = input.Label; | ||
// The standard set used in tests has 150 rows | ||
output.GroupId = (ushort)rng.Next(0, 30); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ushort [](start = 34, length = 6)
any reason why it's ushort? #Resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
namespace Microsoft.ML.Functional.Tests.Datasets | ||
{ | ||
/// <summary> | ||
/// A class containing one property per <see cref="DataKind"/>. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// A class containing one property per . [](start = 4, length = 63)
I don't get this sentence. What DataKind has to do with MF? Your data is row+col+value triplets for matrix. #Resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR adds functional tests for all training and evaluation tasks.
Fixes #2621