Skip to content

Commit f67e38e

Browse files
committed
Resolve merge conflicts and some more PR related comments.
1 parent 5b475ee commit f67e38e

File tree

6 files changed

+26
-26
lines changed

6 files changed

+26
-26
lines changed

src/Microsoft.ML.FastTree/BoostingFastTree.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ public abstract class BoostingFastTreeTrainerBase<TArgs, TTransformer, TModel> :
1414
where TArgs : BoostedTreeArgs, new()
1515
where TModel : class
1616
{
17-
internal BoostingFastTreeTrainerBase(IHostEnvironment env, TArgs args, SchemaShape.Column label) : base(env, args, label)
17+
private protected BoostingFastTreeTrainerBase(IHostEnvironment env, TArgs args, SchemaShape.Column label) : base(env, args, label)
1818
{
1919
}
2020

21-
internal BoostingFastTreeTrainerBase(IHostEnvironment env,
21+
private protected BoostingFastTreeTrainerBase(IHostEnvironment env,
2222
SchemaShape.Column label,
2323
string featureColumn,
2424
string weightColumn,
@@ -161,7 +161,7 @@ private protected override int GetBestIteration(IChannel ch)
161161
/// <summary>
162162
/// Retrieves max tree output if best regression step option is active or returns negative value otherwise.
163163
/// </summary>
164-
internal double BsrMaxTreeOutput()
164+
private protected double BsrMaxTreeOutput()
165165
{
166166
if (FastTreeTrainerOptions.BestStepRankingRegressionTrees)
167167
return FastTreeTrainerOptions.MaxTreeOutput;

src/Microsoft.ML.FastTree/GamClassification.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ private protected override CalibratedModelParametersBase<BinaryClassificationGam
112112
return new ValueMapperCalibratedModelParameters<BinaryClassificationGamModelParameters, PlattCalibrator>(Host, predictor, calibrator);
113113
}
114114

115-
internal override ObjectiveFunctionBase CreateObjectiveFunction()
115+
private protected override ObjectiveFunctionBase CreateObjectiveFunction()
116116
{
117117
return new FastTreeBinaryClassificationTrainer.ObjectiveImpl(
118118
TrainSet,
@@ -129,7 +129,7 @@ internal override ObjectiveFunctionBase CreateObjectiveFunction()
129129
);
130130
}
131131

132-
internal override void DefinePruningTest()
132+
private protected override void DefinePruningTest()
133133
{
134134
var validTest = new BinaryClassificationTest(ValidSetScore,
135135
ConvertTargetsToBool(ValidSet.Targets), _sigmoidParameter);

src/Microsoft.ML.FastTree/GamModelParameters.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ private protected GamModelParametersBase(IHostEnvironment env, string name,
115115
_outputType = NumberDataViewType.Single;
116116
}
117117

118-
internal GamModelParametersBase(IHostEnvironment env, string name, ModelLoadContext ctx)
118+
private protected GamModelParametersBase(IHostEnvironment env, string name, ModelLoadContext ctx)
119119
: base(env, name)
120120
{
121121
Host.CheckValue(ctx, nameof(ctx));

src/Microsoft.ML.FastTree/GamRegression.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,12 @@ private protected override RegressionGamModelParameters TrainModelCore(TrainCont
7474
return new RegressionGamModelParameters(Host, BinUpperBounds, BinEffects, MeanEffect, InputLength, FeatureMap);
7575
}
7676

77-
internal override ObjectiveFunctionBase CreateObjectiveFunction()
77+
private protected override ObjectiveFunctionBase CreateObjectiveFunction()
7878
{
7979
return new FastTreeRegressionTrainer.ObjectiveImpl(TrainSet, Args);
8080
}
8181

82-
internal override void DefinePruningTest()
82+
private protected override void DefinePruningTest()
8383
{
8484
var validTest = new RegressionTest(ValidSetScore, Args.PruningMetrics);
8585
// Because we specify pruning metrics as L2 by default, the results array will have 1 value

src/Microsoft.ML.FastTree/GamTrainer.cs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -110,22 +110,22 @@ public abstract class OptionsBase : LearnerInputBaseWithWeight
110110
private const string RegisterName = "GamTraining";
111111

112112
//Parameters of training
113-
internal readonly TArgs Args;
113+
private protected readonly TArgs Args;
114114
private readonly double _gainConfidenceInSquaredStandardDeviations;
115115
private readonly double _entropyCoefficient;
116116

117117
//Dataset information
118-
internal Dataset TrainSet;
119-
internal Dataset ValidSet;
118+
private protected Dataset TrainSet;
119+
private protected Dataset ValidSet;
120120
/// <summary>
121121
/// Whether a validation set was passed in
122122
/// </summary>
123-
internal bool HasValidSet => ValidSet != null;
124-
internal ScoreTracker TrainSetScore;
125-
internal ScoreTracker ValidSetScore;
126-
internal TestHistory PruningTest;
127-
internal int PruningLossIndex;
128-
internal int InputLength;
123+
private protected bool HasValidSet => ValidSet != null;
124+
private protected ScoreTracker TrainSetScore;
125+
private protected ScoreTracker ValidSetScore;
126+
private protected TestHistory PruningTest;
127+
private protected int PruningLossIndex;
128+
private protected int InputLength;
129129
private LeastSquaresRegressionTreeLearner.LeafSplitCandidates _leafSplitCandidates;
130130
private SufficientStatsBase[] _histogram;
131131
private ILeafSplitStatisticsCalculator _leafSplitHelper;
@@ -136,10 +136,10 @@ public abstract class OptionsBase : LearnerInputBaseWithWeight
136136
private SubGraph _subGraph;
137137

138138
//Results of training
139-
internal double MeanEffect;
140-
internal double[][] BinEffects;
141-
internal double[][] BinUpperBounds;
142-
internal int[] FeatureMap;
139+
private protected double MeanEffect;
140+
private protected double[][] BinEffects;
141+
private protected double[][] BinUpperBounds;
142+
private protected int[] FeatureMap;
143143

144144
public override TrainerInfo Info { get; }
145145
private protected virtual bool NeedCalibration => false;
@@ -224,7 +224,7 @@ private void DefineScoreTrackers()
224224
ValidSetScore = new ScoreTracker("valid", ValidSet, null);
225225
}
226226

227-
internal abstract void DefinePruningTest();
227+
private protected abstract void DefinePruningTest();
228228

229229
private protected abstract void CheckLabel(RoleMappedData data);
230230

@@ -520,7 +520,7 @@ private void CenterGraph()
520520
/// Process bins such that only bin upper bounds and bin effects remain where
521521
/// the effect changes.
522522
/// </summary>
523-
internal void CreateEfficientBinning()
523+
private protected void CreateEfficientBinning()
524524
{
525525
BinUpperBounds = new double[TrainSet.NumFeatures][];
526526
var newBinEffects = new List<double>();
@@ -595,7 +595,7 @@ private void InitializeThreads()
595595
ThreadTaskManager.Initialize(numThreads);
596596
}
597597

598-
internal abstract ObjectiveFunctionBase CreateObjectiveFunction();
598+
private protected abstract ObjectiveFunctionBase CreateObjectiveFunction();
599599

600600
private class LeafSplitHelper : ILeafSplitStatisticsCalculator
601601
{

src/Microsoft.ML.FastTree/RandomForest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public abstract class RandomForestTrainerBase<TArgs, TTransformer, TModel> : Fas
1414
/// <summary>
1515
/// Constructor invoked by the maml code-path.
1616
/// </summary>
17-
internal RandomForestTrainerBase(IHostEnvironment env, TArgs args, SchemaShape.Column label, bool quantileEnabled = false)
17+
private protected RandomForestTrainerBase(IHostEnvironment env, TArgs args, SchemaShape.Column label, bool quantileEnabled = false)
1818
: base(env, args, label)
1919
{
2020
_quantileEnabled = quantileEnabled;
@@ -23,7 +23,7 @@ internal RandomForestTrainerBase(IHostEnvironment env, TArgs args, SchemaShape.C
2323
/// <summary>
2424
/// Constructor invoked by the API code-path.
2525
/// </summary>
26-
internal RandomForestTrainerBase(IHostEnvironment env,
26+
private protected RandomForestTrainerBase(IHostEnvironment env,
2727
SchemaShape.Column label,
2828
string featureColumn,
2929
string weightColumn,

0 commit comments

Comments
 (0)