Skip to content

Conversation

@robosek
Copy link
Contributor

@robosek robosek commented Nov 17, 2018

Fixes #1280

NOTE:

  • Moved results from (Ranking, Multiclass, Regression, Clustering, Binary) evaluators to separte classes under Evaluators/Metrics directory.
  • Adjusted types in dependent projects classes.
  • Build Release and Debug successful on local 👍

@TomFinley TomFinley requested review from Zruty0 and sfilipi and removed request for Zruty0 November 18, 2018 02:35
Zruty0
Zruty0 previously requested changes Nov 19, 2018
Copy link
Contributor

@Zruty0 Zruty0 left a 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 ?

@robosek
Copy link
Contributor Author

robosek commented Nov 19, 2018

@Zruty0 You mean I should change only the namespaces to Microsoft.ML.Data of new classes right? #Resolved

@Zruty0
Copy link
Contributor

Zruty0 commented Nov 19, 2018

@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.
Copy link
Member

@sfilipi sfilipi Nov 20, 2018

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
Copy link
Member

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?

Copy link
Contributor Author

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)
Copy link
Member

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?

Copy link
Contributor Author

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>
Copy link
Contributor

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>
Copy link
Contributor

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>
Copy link
Contributor

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
Copy link
Contributor

@Ivanidzo4ka Ivanidzo4ka Nov 27, 2018

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>
Copy link
Contributor

@Ivanidzo4ka Ivanidzo4ka Nov 27, 2018

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.
Copy link
Contributor

@Ivanidzo4ka Ivanidzo4ka Nov 27, 2018

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;
Copy link
Contributor

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.

Copy link
Contributor

@Ivanidzo4ka Ivanidzo4ka left a comment

Choose a reason for hiding this comment

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

:shipit:

@Ivanidzo4ka
Copy link
Contributor

Ivanidzo4ka commented Nov 27, 2018

@robosek thank you for your contribution!
I left few comments, and you need to resolve some merge conflicts (it's end of cycle time, so people tend to push lot of PRs)
#Resolved

@robosek
Copy link
Contributor Author

robosek commented Nov 28, 2018

@Ivanidzo4ka thank you for your review. Descriptions are updated and conflicts are resolved (at least for a while 😃) #Resolved

@Ivanidzo4ka
Copy link
Contributor

@robosek can you do following:
open command line and go to your machinelearning repository.
git submodule update --remote --merge
you should get following message in the end:

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.
Command above will point on latest master branch in libmf.

@robosek
Copy link
Contributor Author

robosek commented Nov 28, 2018

@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).
Copy link
Contributor

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.

@robosek
Copy link
Contributor Author

robosek commented Nov 28, 2018

@Ivanidzo4ka of course. Done 😛

@shauheen shauheen dismissed Zruty0’s stale review November 28, 2018 22:58

Reviewer is not available now, the PR is updated.

Copy link
Member

@sfilipi sfilipi left a comment

Choose a reason for hiding this comment

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

:shipit:

@sfilipi sfilipi merged commit c3a20fa into dotnet:master Nov 29, 2018
@ghost ghost locked as resolved and limited conversation to collaborators Mar 26, 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