-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Move evaluation results to separate classes #1663
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
Conversation
Zruty0
left a comment
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.
Thanks @robosek for your contribution!
It looks good to me, except could you please move all these new classes to Microsoft.ML.Data ?
|
@Zruty0 You mean I should change only the namespaces to |
|
@robosek yes, that's what I meant #Resolved |
| public double Nmi { get; } | ||
|
|
||
| /// <summary> | ||
| /// Average Score. For the K-Means algorithm, the 'score' is the distance from the centroid to the example. |
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.
' [](start = 58, length = 1)
The apostrophes were already there, but we might need to XML encode them, here and below. #Resolved
| var metricsDic = evaluator.Evaluate(dataEval); | ||
|
|
||
| return BinaryClassificationMetrics.FromMetrics(env, metricsDic["OverallMetrics"], metricsDic["ConfusionMatrix"])[0]; | ||
| return Microsoft.ML.Legacy.Models.BinaryClassificationMetrics |
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.
Microsoft.ML.Legacy.Models [](start = 19, length = 26)
does this need to be Microsoft.ML.Data?
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.
Actually before my change it was BinaryClassificationMetrics from Microsoft.ML.Legacy.Models but I had to add full name of class to distinguish between new BinaryClassificationMetrics from Micorosft.ML.Data and the legacy one.
| } | ||
|
|
||
| private BinaryClassificationMetrics EvaluateBinary(IHostEnvironment env, IDataView scoredData) | ||
| private Microsoft.ML.Legacy.Models.BinaryClassificationMetrics EvaluateBinary(IHostEnvironment env, IDataView scoredData) |
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.
Microsoft.ML.Legacy.Models [](start = 16, length = 26)
Microsoft.ML.Data?
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.
The same as above
| public double AvgMinScore { get; } | ||
|
|
||
| /// <summary> | ||
| /// <a href="https://en.wikipedia.org/wiki/Davies�Bouldin_index">Davies-Bouldin Index</a> |
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.
� [](start = 57, length = 1)
something went wrong with this hypen. I can't open link.
[https://en.wikipedia.org/wiki/Davies–Bouldin_index](https://en.wikipedia.org/wiki/Davies–Bouldin_index`) works fine
| { | ||
| /// <summary> | ||
| /// Normalized Discounted Cumulative Gain | ||
| /// <a href="https://github.com/dotnet/machinelearning/tree/master/docs/images/ndcg.png"></a> |
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.
ndcg [](start = 87, length = 4)
need to be NDCG.png
| /// <a href="https://en.wikipedia.org/wiki/Discounted_cumulative_gain">Discounted Cumulative gain</a> | ||
| /// is the sum of the gains, for all the instances i, normalized by the natural logarithm of the instance + 1. | ||
| /// Note that unline the Wikipedia article, ML.Net uses the natural logarithm. | ||
| /// <a href="https://github.com/dotnet/machinelearning/tree/master/docs/images/dcg.png"></a> |
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.
dcg.png [](start = 87, length = 7)
need to be DCG.png
| public sealed class RankerMetrics | ||
| { | ||
| /// <summary> | ||
| /// Normalized Discounted Cumulative Gain |
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.
Normalized Discounted Cumulative Gain [](start = 12, length = 37)
Array of normalized discounted cumulative gains where i-th element represent NDCG@i (you can also phrase it as NDCG at i). #Closed
| /// </summary> | ||
| public double[] Ndcg { get; } | ||
|
|
||
| /// <summary> |
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.
Array of discounted cumulative gains where i-th element represent DCG@i (you can also phrase it as DCG at i). #Closed
| public double Rms { get; } | ||
|
|
||
| /// <summary> | ||
| /// Gets the user defined loss function. |
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.
Gets the user [](start = 12, length = 13)
Gets the result of user defined loss function.
or
Get result of the user defined loss function.
English is hard.
My point is we don't return loss function we return result of it. #Closed
| using System.Collections.Generic; | ||
| using System.Linq; | ||
| using System.Text; | ||
| using Microsoft.ML.Data; |
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.
would be nice to sort them.
Ivanidzo4ka
left a comment
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.
![]()
|
@robosek thank you for your contribution! |
|
@Ivanidzo4ka thank you for your review. Descriptions are updated and conflicts are resolved (at least for a while 😃) #Resolved |
|
@robosek can you do following: Submodule path 'src/Native/MatrixFactorizationNative/libmf': merged in '53a91e7e8c88463e97acfbbafb7134a6030860b3' stage it and merge into your PR. We have submodule which we recently updated in master, but in your branch it's still looking on old one, and for some reason git not smart enough to merge it properly. |
|
@Ivanidzo4ka I did before but this time I forgot to merge submodules. Sorry! Now it's merged as well 👍 |
| public sealed class RankerMetrics | ||
| { | ||
| /// <summary> | ||
| /// Array of normalized discounted cumulative gains where i-th element represent NDCG@i (you can also phrase it as NDCG at i). |
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.
(you can also phrase it as NDCG at i) [](start = 96, length = 37)
You don't have to write this. I just try to give you option how you can phrase it :)
it's either NDCG@i or NGDCG at i, both a valid names.
|
@Ivanidzo4ka of course. Done 😛 |
Reviewer is not available now, the PR is updated.
sfilipi
left a comment
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.
![]()
Fixes #1280
NOTE:
Evaluators/Metricsdirectory.ReleaseandDebugsuccessful on local 👍