-
Notifications
You must be signed in to change notification settings - Fork 1.9k
In the public surface area, all occurrences of Argument keyword replaced with Options #2563
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
@@ -49,7 +49,7 @@ internal static class FastTreeShared | |||
public abstract class FastTreeTrainerBase<TArgs, TTransformer, TModel> : | |||
TrainerEstimatorBaseWithGroupId<TTransformer, TModel> | |||
where TTransformer : ISingleFeaturePredictionTransformer<TModel> | |||
where TArgs : TreeArgs, new() | |||
where TArgs : TreeOptions, new() |
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.
TArgs [](start = 14, length = 5)
TOptions #Resolved
@@ -49,7 +49,7 @@ internal static class FastTreeShared | |||
public abstract class FastTreeTrainerBase<TArgs, TTransformer, TModel> : | |||
TrainerEstimatorBaseWithGroupId<TTransformer, TModel> | |||
where TTransformer : ISingleFeaturePredictionTransformer<TModel> | |||
where TArgs : TreeArgs, new() | |||
where TArgs : TreeOptions, new() | |||
where TModel : class | |||
{ | |||
protected readonly TArgs Args; |
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.
TArgs Args [](start = 27, length = 10)
TOptions Options; #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.
Options cause compile errors because of conflict with class Options. Renamed to FastTreeTrainerOptions
In reply to: 257077340 [](ancestors = 257077340)
float l2RegularizerWeight = AveragedLinearArguments.AveragedDefaultArgs.L2RegularizerWeight, | ||
int numIterations = AveragedLinearArguments.AveragedDefaultArgs.NumIterations) | ||
float learningRate = AveragedLinearOptions.AveragedDefaultArgs.LearningRate, | ||
bool decreaseLearningRate = AveragedLinearOptions.AveragedDefaultArgs.DecreaseLearningRate, |
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.
AveragedDefaultArgs [](start = 62, length = 19)
Would rename to AveragedDefaults same for base class for this class. Just remove Arg. #Resolved
Codecov Report
@@ Coverage Diff @@
## master #2563 +/- ##
=========================================
Coverage ? 71.5%
=========================================
Files ? 801
Lines ? 142036
Branches ? 16151
=========================================
Hits ? 101558
Misses ? 36005
Partials ? 4473
|
@@ -62,7 +62,7 @@ public abstract class ArgumentsBase { } | |||
} | |||
} | |||
|
|||
internal EarlyStoppingCriterion(TArguments args, bool lowerIsBetter) | |||
internal EarlyStoppingCriterion(TOptions args, bool lowerIsBetter) |
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.
args [](start = 49, length = 4)
Could you rename the local variable names as well? Here and in the rest of the file? #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.
fixed.
fyi.. in this PR the focus is scrubbing the public surface area for Options options
.
There are still lots of internal
occurrences of Arguments args
.. Those are P2 since they can be renamed post V1.0 as well
In reply to: 257144702 [](ancestors = 257144702)
@@ -176,7 +176,7 @@ public sealed class Arguments : ISupportSdcaClassificationLossFactory, ISupportC | |||
private const Float Threshold = 0.5f; | |||
private readonly Float _margin; | |||
|
|||
internal HingeLoss(Arguments args) | |||
internal HingeLoss(Options args) |
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.
args [](start = 35, length = 4)
Same here, I guess this is a comment that applies to all the files where you rename Arguments to Options. #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.
fixed.
fyi.. in this PR the focus is scrubbing the public surface area for Options options
.
There are still lots of internal
occurrences of Arguments args
.. Those are P2 since they can be renamed post V1.0 as well
In reply to: 257145148 [](ancestors = 257145148)
Yes I am merging the two classes Arguments and ArgumentsCore into a single Options class. #Resolved |
Sorry the github comment went under discussion. I am taking care of this in my other PR. In reply to: 464209630 [](ancestors = 464209630,464199502) Refers to: src/Microsoft.ML.Data/DataLoadSave/Text/TextLoader.cs:336 in e9409ca. [](commit_id = e9409ca, deletion_comment = False) |
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.
@@ -89,7 +89,7 @@ protected bool CheckBestScore(Float score) | |||
public sealed class TolerantEarlyStoppingCriterion : EarlyStoppingCriterion<TolerantEarlyStoppingCriterion.Arguments> | |||
{ | |||
[TlcModule.Component(FriendlyName = "Tolerant (TR)", Name = "TR", Desc = "Stop if validation score exceeds threshold value.")] | |||
public class Arguments : ArgumentsBase, IEarlyStoppingCriterionFactory | |||
public class Arguments : OptionsBase, IEarlyStoppingCriterionFactory |
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.
Arguments [](start = 21, length = 9)
Could you rename this to Options? #Resolved
@@ -126,7 +126,7 @@ public override bool CheckScore(Float validationScore, Float trainingScore, out | |||
|
|||
public abstract class MovingWindowEarlyStoppingCriterion : EarlyStoppingCriterion<MovingWindowEarlyStoppingCriterion.Arguments> | |||
{ | |||
public class Arguments : ArgumentsBase | |||
public class Arguments : OptionsBase |
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.
Arguments [](start = 21, length = 9)
Same here #Resolved
@@ -33,7 +33,7 @@ private static VersionInfo GetVersionInfo() | |||
loaderAssemblyName: typeof(MultiVoting).Assembly.FullName); | |||
} | |||
|
|||
private sealed class Arguments : ArgumentsBase |
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.
Arguments [](start = 29, length = 9)
Even if it's private would be good to rename this one too. #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.
i am not touching the private ones in this PR.. (i think i mentioned this in my reply to the other comment)
In reply to: 257413177 [](ancestors = 257413177)
maybe in a separate PR . as discussed first priority is to scrub public surface first. In reply to: 464229576 [](ancestors = 464229576) Refers to: src/Microsoft.ML.Ensemble/Trainer/Multiclass/MulticlassDataPartitionEnsembleTrainer.cs:39 in e9409ca. [](commit_id = e9409ca, deletion_comment = False) |
ok cool. i will keep it as-is in for now In reply to: 464212257 [](ancestors = 464212257) |
The current changes look good! As mentioned in person, I think we should use the tool to get a list of all the objects in the public surface of ML.NET and see if any of them includes If you could run the tool and provide an output file that we can review, it would be extremely useful and we could actually consider this task as being done. In the meantime let's check in this PR and avoid more conflicts. #Resolved |
Please do address the few renaming suggestions I made for public classes. #Resolved |
Sure. i have taken care of the open comments. In reply to: 464233544 [](ancestors = 464233544) |
Sure. I will run a sanity check with the tool, so we know we have caught all of them. Till then I will keep issue open. Thanks for the suggestion. In reply to: 464233157 [](ancestors = 464233157) |
Thanks folks for the review comments! |
Fixes #2557
For public API surface, all occurrences of Argument keyword replaced with Options
Several internal classes continue to be called
Arguments
. We can target those post V1.0 since they are not part of public surface area anyway.