Skip to content

Commit 1ae455e

Browse files
committed
Internalize little less trivial stuff.
1 parent e0e62b3 commit 1ae455e

16 files changed

+140
-141
lines changed

src/Microsoft.ML.FastTree/BoostingFastTree.cs

+7-7
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ public abstract class BoostingFastTreeTrainerBase<TArgs, TTransformer, TModel> :
1515
where TArgs : BoostedTreeArgs, new()
1616
where TModel : class
1717
{
18-
protected BoostingFastTreeTrainerBase(IHostEnvironment env, TArgs args, SchemaShape.Column label) : base(env, args, label)
18+
internal BoostingFastTreeTrainerBase(IHostEnvironment env, TArgs args, SchemaShape.Column label) : base(env, args, label)
1919
{
2020
}
2121

22-
protected BoostingFastTreeTrainerBase(IHostEnvironment env,
22+
internal BoostingFastTreeTrainerBase(IHostEnvironment env,
2323
SchemaShape.Column label,
2424
string featureColumn,
2525
string weightColumn,
@@ -33,7 +33,7 @@ protected BoostingFastTreeTrainerBase(IHostEnvironment env,
3333
Args.LearningRates = learningRate;
3434
}
3535

36-
protected override void CheckArgs(IChannel ch)
36+
internal override void CheckArgs(IChannel ch)
3737
{
3838
if (Args.OptimizationAlgorithm == BoostedTreeArgs.OptimizationAlgorithmType.AcceleratedGradientDescent)
3939
Args.UseLineSearch = true;
@@ -116,7 +116,7 @@ internal override IGradientAdjuster MakeGradientWrapper(IChannel ch)
116116
return new BestStepRegressionGradientWrapper();
117117
}
118118

119-
protected override bool ShouldStop(IChannel ch, ref IEarlyStoppingCriterion earlyStoppingRule, ref int bestIteration)
119+
internal override bool ShouldStop(IChannel ch, ref IEarlyStoppingCriterion earlyStoppingRule, ref int bestIteration)
120120
{
121121
if (Args.EarlyStoppingRule == null)
122122
return false;
@@ -148,7 +148,7 @@ protected override bool ShouldStop(IChannel ch, ref IEarlyStoppingCriterion earl
148148
return shouldStop;
149149
}
150150

151-
protected override int GetBestIteration(IChannel ch)
151+
internal override int GetBestIteration(IChannel ch)
152152
{
153153
int bestIteration = Ensemble.NumTrees;
154154
if (!Args.WriteLastEnsemble && PruningTest != null)
@@ -162,15 +162,15 @@ protected override int GetBestIteration(IChannel ch)
162162
/// <summary>
163163
/// Retrieves max tree output if best regression step option is active or returns negative value otherwise.
164164
/// </summary>
165-
protected double BsrMaxTreeOutput()
165+
internal double BsrMaxTreeOutput()
166166
{
167167
if (Args.BestStepRankingRegressionTrees)
168168
return Args.MaxTreeOutput;
169169
else
170170
return -1;
171171
}
172172

173-
protected override bool ShouldRandomStartOptimizer()
173+
internal override bool ShouldRandomStartOptimizer()
174174
{
175175
return Args.RandomStart;
176176
}

0 commit comments

Comments
 (0)