Skip to content

Fix a bug with group Id column in CV macro and add NameColumn argument to CV and TrainTest macros #467

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

Merged
merged 4 commits into from
Jul 3, 2018

Conversation

yaeldekel
Copy link

This PR fixes bug #456, and also introduces a NameColumn argument to the TrainTest and CV macros, to enable the evaluator to use it in the per-instance results.
Fixes #456
Fixes #466

@yaeldekel yaeldekel requested review from codemzs and Ivanidzo4ka July 2, 2018 16:51
@@ -535,9 +535,9 @@ public float Cost
ch.Assert(groupColFieldType == typeof(string));
var inputGroup = inputInstance.GetType().GetField(groupColField).GetValue(inputInstance);
if (group != (Optional<string>)inputGroup)
ch.Warning(warning, "group Id", label, inputGroup);
ch.Warning(warning, "group Id", group, inputGroup);
Copy link
Contributor

@Ivanidzo4ka Ivanidzo4ka Jul 2, 2018

Choose a reason for hiding this comment

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

group [](start = 52, length = 5)

ugh.
Thank you finding this, and fixing it! #Resolved

@Ivanidzo4ka
Copy link
Contributor

Ivanidzo4ka commented Jul 2, 2018

                _inputBuilder.TrySetValue(labelColField, label);

this pattern now appears in 4 places, should we refactor it? #Closed


Refers to: src/Microsoft.ML.Data/EntryPoints/EntryPointNode.cs:527 in 1d55c6c. [](commit_id = 1d55c6c, deletion_comment = False)

public Optional<string> GroupColumn = Optional<string>.Implicit(DefaultColumnNames.GroupId);

[Argument(ArgumentType.AtMostOnce, HelpText = "Name column name", ShortName = "name", SortOrder = 6)]
Copy link
Contributor

@Ivanidzo4ka Ivanidzo4ka Jul 2, 2018

Choose a reason for hiding this comment

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

nit:
sort order is same for weight, kind, name, but 12 for group column. #Closed

public Optional<string> GroupColumn = Optional<string>.Implicit(DefaultColumnNames.GroupId);

[Argument(ArgumentType.AtMostOnce, HelpText = "Name column name", ShortName = "name", SortOrder = 6)]
Copy link
Contributor

@Ivanidzo4ka Ivanidzo4ka Jul 2, 2018

Choose a reason for hiding this comment

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

6 [](start = 110, length = 1)

should it be 13? #Closed

return new MultiOutputRegressionMamlEvaluator(env, new MultiOutputRegressionMamlEvaluator.Arguments());
default:
throw env.ExceptParam(nameof(kind), $"Trainer kind {kind} does not have an evaluator");
case MacroUtils.TrainerKinds.SignatureBinaryClassifierTrainer:
Copy link
Contributor

@Ivanidzo4ka Ivanidzo4ka Jul 2, 2018

Choose a reason for hiding this comment

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

        [](start = 0, length = 12)

My VS put extra indent after "{" so if I format code, i get current formatting.
So next time if I happen to format this file, I'll revert your changes.
It's not a blocker, but maybe we need to discuss at some point default VS setting... #Closed

public Optional<string> GroupColumn = Optional<string>.Implicit(DefaultColumnNames.GroupId);

[Argument(ArgumentType.AtMostOnce, HelpText = "Name column name", ShortName = "name", SortOrder = 6)]
Copy link
Contributor

@Ivanidzo4ka Ivanidzo4ka Jul 2, 2018

Choose a reason for hiding this comment

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

13? #Closed

if (name != (Optional<string>)inputName)
ch.Warning(warning, "name", name, inputName);
else
_inputBuilder.TrySetValue(nameColField, weight);
Copy link
Contributor

@Ivanidzo4ka Ivanidzo4ka Jul 2, 2018

Choose a reason for hiding this comment

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

weight [](start = 60, length = 6)

name! #Closed

Copy link
Author

Choose a reason for hiding this comment

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

Thank you for finding!


In reply to: 199586356 [](ancestors = 199586356)

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.

🕐

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:

Copy link
Contributor

@TomFinley TomFinley left a comment

Choose a reason for hiding this comment

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

:shipit:

@TomFinley TomFinley merged commit f3d57a1 into dotnet:master Jul 3, 2018
eerhardt pushed a commit to eerhardt/machinelearning that referenced this pull request Jul 27, 2018
…t to CV and TrainTest macros (dotnet#467)

* Fix a bug with group Id column in CV macro
* add NameColumn argument
@ghost ghost locked as resolved and limited conversation to collaborators Mar 30, 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.

CV macro should be able to pass a name column to the evaluator Cross validation macro doesn't work with non-default group column name
4 participants