-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Modify API for advanced settings (GAM learners) #2199
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
Modify API for advanced settings (GAM learners) #2199
Conversation
args.Check(Host); | ||
_options = args; | ||
options.Check(Host); | ||
_options = options; |
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 = options; [](start = 10, length = 21)
check #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.
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.
🚢 🇮🇹
@@ -50,8 +50,8 @@ public sealed class Arguments : ArgumentsBase | |||
/// <summary> | |||
/// Initializes a new instance of <see cref="BinaryClassificationGamTrainer"/> | |||
/// </summary> | |||
internal BinaryClassificationGamTrainer(IHostEnvironment env, Arguments args) | |||
: base(env, args, LoadNameValue, TrainerUtils.MakeBoolScalarLabel(args.LabelColumn)) | |||
internal BinaryClassificationGamTrainer(IHostEnvironment env, Options options) |
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.
One thing that I've noticed about this switch to options
is that we have two APIs for each learner: One with options
, and one with a subset of the options
spelled out. Wouldn't it make sense to only have one constructor that took options, and have the Catalog interface handle the multiplicity of ways to construct it?
That is, only have
new MyTrainer(env, options)
And then have the catalog do this:
public static BinaryClassificationGamTrainer GeneralizedAdditiveModels(this BinaryClassificationCatalog.BinaryClassificationTrainers catalog,
string labelColumn = DefaultColumnNames.Label,
string featureColumn = DefaultColumnNames.Features,
string weights = null,
int numIterations = GamDefaults.NumIterations,
double learningRate = GamDefaults.LearningRates,
int maxBins = GamDefaults.MaxBins)
{
Contracts.CheckValue(catalog, nameof(catalog));
var env = CatalogUtils.GetEnvironment(catalog);
var options = new BinaryClassificationGamTrainer.Options{
xyz = etc
}
return new BinaryClassificationGamTrainer(env, 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.
Towards #1798 .
This PR addresses the following algos
The following changes have been made:
public
extension methods, one for simple arguments and the other for advanced optionsinternal