-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
Currently in our codebase, we have two constructors
that are used for initialization of the underlying object.
Example:
A.
machinelearning/src/Microsoft.ML.FastTree/FastTreeRanking.cs
Lines 75 to 84 in bdc9a9e
public FastTreeRankingTrainer(IHostEnvironment env, | |
string labelColumn = DefaultColumnNames.Label, | |
string featureColumn = DefaultColumnNames.Features, | |
string groupIdColumn = DefaultColumnNames.GroupId, | |
string weightColumn = null, | |
int numLeaves = Defaults.NumLeaves, | |
int numTrees = Defaults.NumTrees, | |
int minDatapointsInLeaves = Defaults.MinDocumentsInLeaves, | |
double learningRate = Defaults.LearningRates, | |
Action<Arguments> advancedSettings = null) |
B.
machinelearning/src/Microsoft.ML.FastTree/FastTreeRanking.cs
Lines 93 to 95 in bdc9a9e
internal FastTreeRankingTrainer(IHostEnvironment env, Arguments args) | |
: base(env, args, TrainerUtils.MakeR4ScalarColumn(args.LabelColumn)) | |
{ |
We need to bringing the public API surface to the desired shape. As such, we are making both constructors internal
, and fixing other issues with the public API as outlined in #1798.
Additionally, constructor (B) has all the details for constructing the underlying object. As such, we can delete constructor (A) altogether.
NOTE: We will do this issue only after finishing the work to bring public API to the desired shape .
Constructors that need closer look towards unification:
SdcaBinaryTrainer
SdcaMultiClassTrainer
SdcaRegressionTrainer
StochasticGradientDescentClassificationTrainer
FastTreeRankingTrainer
FastTreeRegressionTrainer
FastTreeBinaryClassificationTrainer
FastForestClassification
FastForestRegression
PoissonRegression
LogisticRegression
BinaryClassificationGamTrainer
LightGbmBinaryTrainer
LightGbmMulticlassTrainer
LightGbmRankingTrainer
LightGbmRegressorTrainer