Skip to content

Move Learner* input base and Transform* input base out of Entrypoints… #2748

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 18 commits into from
Feb 28, 2019
Merged

Move Learner* input base and Transform* input base out of Entrypoints… #2748

merged 18 commits into from
Feb 28, 2019

Conversation

ganik
Copy link
Member

@ganik ganik commented Feb 26, 2019

fixes #2582
fixes #2760

[BestFriend]
internal static class LearnerEntryPointsUtils
{
public static string FindColumn(IExceptionContext ectx, DataViewSchema schema, Optional<string> value)
Copy link
Contributor

@Ivanidzo4ka Ivanidzo4ka Feb 26, 2019

Choose a reason for hiding this comment

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

FindColumn [](start = 29, length = 10)

why you moving this one? #Resolved

Copy link
Member Author

Choose a reason for hiding this comment

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

it depends on LearnerInput* classes


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

/// The base class for all learner inputs.
/// </summary>
[TlcModule.EntryPointKind(typeof(CommonInputs.ITrainerInput))]
public abstract class LearnerInputBase
Copy link
Contributor

@Ivanidzo4ka Ivanidzo4ka Feb 26, 2019

Choose a reason for hiding this comment

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

Learner [](start = 26, length = 7)

We discuss this today, and all LearnerSomething should become TrainerSomething LearnerInputBase ->TrainerInputBase #Resolved

Copy link
Contributor

Choose a reason for hiding this comment

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

Which can be scope of other PR


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

Copy link
Member Author

Choose a reason for hiding this comment

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

this done


In reply to: 260527749 [](ancestors = 260527749,260525998)

namespace Microsoft.ML.Trainers
{
/// <summary>
/// The base class for all learner inputs.
Copy link
Member

@eerhardt eerhardt Feb 27, 2019

Choose a reason for hiding this comment

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

learner => trainer #Resolved

Copy link
Member

@eerhardt eerhardt left a comment

Choose a reason for hiding this comment

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

:shipit:

}

[BestFriend]
internal static class TrainerEntryPointsUtils
Copy link
Contributor

@TomFinley TomFinley Feb 27, 2019

Choose a reason for hiding this comment

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

TrainerEntryPointsUtils [](start = 26, length = 23)

As near as I can tell this is specific to entry-point applications and infrastructure, and should remain with the internal classes inside entry-points namespace. #Resolved

/// The base class for all transform inputs.
/// </summary>
[TlcModule.EntryPointKind(typeof(CommonInputs.ITransformInput))]
public abstract class TransformInputBase
Copy link
Contributor

@TomFinley TomFinley Feb 27, 2019

Choose a reason for hiding this comment

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

TransformInputBase [](start = 26, length = 18)

This class should have a [BestFriend] private protected constructor. We do not want people forming base classes willy nilly. #Resolved

/// The base class for all trainer inputs.
/// </summary>
[TlcModule.EntryPointKind(typeof(CommonInputs.ITrainerInput))]
public abstract class TrainerInputBase
Copy link
Contributor

@TomFinley TomFinley Feb 27, 2019

Choose a reason for hiding this comment

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

TrainerInputBase [](start = 26, length = 16)

This class should have a [BestFriend] private protected constructor. We do not want people forming base classes from it willy nilly. Similar with all the other abstract classes defined here. #Resolved

Copy link
Contributor

Choose a reason for hiding this comment

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

This could potentially be part of another PR. But, it's relatively easy to do if you have to change the PR for some other reason anyway.


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

/// Column to use for features.
/// </summary>
[Argument(ArgumentType.AtMostOnce, HelpText = "Column to use for features", ShortName = "feat", SortOrder = 2, Visibility = ArgumentAttribute.VisibilityType.EntryPointsOnly)]
public string FeatureColumn = DefaultColumnNames.Features;
Copy link
Contributor

@Ivanidzo4ka Ivanidzo4ka Feb 27, 2019

Choose a reason for hiding this comment

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

FeatureColumn [](start = 22, length = 13)

#2760 if you want to can take care of this one as well.
Or someone else can take care of that later. #Closed

Copy link
Member Author

Choose a reason for hiding this comment

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

ok


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

@@ -299,7 +299,7 @@ private List<CoefficientStatistics> GetUnorderedCoefficientStatistics(LinearBina
var names = default(VBuffer<ReadOnlyMemory<char>>);

featureColumn.Annotations.GetValue(AnnotationUtils.Kinds.SlotNames, ref names);
_env.Assert(names.Length > 0, "FeatureColumn has no metadata.");
_env.Assert(names.Length > 0, "FeatureColumnName has no metadata.");
Copy link
Member Author

Choose a reason for hiding this comment

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

Should this be done?

@codecov
Copy link

codecov bot commented Feb 27, 2019

Codecov Report

Merging #2748 into master will increase coverage by <.01%.
The diff coverage is 78.26%.

@@            Coverage Diff             @@
##           master    #2748      +/-   ##
==========================================
+ Coverage   71.65%   71.65%   +<.01%     
==========================================
  Files         807      809       +2     
  Lines      142337   142380      +43     
  Branches    16117    16120       +3     
==========================================
+ Hits       101989   102027      +38     
- Misses      35913    35917       +4     
- Partials     4435     4436       +1
Flag Coverage Δ
#Debug 71.65% <78.26%> (ø) ⬆️
#production 67.9% <72.86%> (ø) ⬆️
#test 85.84% <100%> (ø) ⬆️
Impacted Files Coverage Δ
src/Microsoft.ML.ImageAnalytics/ImageLoader.cs 84.55% <ø> (ø) ⬆️
...crosoft.ML.Ensemble/Trainer/EnsembleTrainerBase.cs 75.42% <ø> (ø) ⬆️
src/Microsoft.ML.ImageAnalytics/ImageResizer.cs 84.64% <ø> (ø) ⬆️
...rosoft.ML.ImageAnalytics/VectorToImageTransform.cs 72.23% <ø> (ø) ⬆️
...Microsoft.ML.ImageAnalytics/ImagePixelExtractor.cs 82.55% <ø> (ø) ⬆️
test/Microsoft.ML.Functional.Tests/Prediction.cs 100% <ø> (ø) ⬆️
src/Microsoft.ML.LightGBM/LightGbmArguments.cs 87.05% <ø> (ø) ⬆️
src/Microsoft.ML.FastTree/FastTreeArguments.cs 85.71% <ø> (ø) ⬆️
src/Microsoft.ML.Data/Transforms/NopTransform.cs 17.64% <ø> (ø) ⬆️
src/Microsoft.ML.ImageAnalytics/ImageGrayscale.cs 78.33% <ø> (ø) ⬆️
... and 74 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:

@TomFinley TomFinley merged commit 0ada2fd into dotnet:master Feb 28, 2019
@ghost ghost locked as resolved and limited conversation to collaborators Mar 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
4 participants