@@ -59,17 +59,17 @@ public abstract class ArgumentsBase : LearnerInputBaseWithLabel
5959
6060 private const int DefaultNumModels = 50 ;
6161 /// <summary> Command-line arguments </summary>
62- protected internal readonly ArgumentsBase Args ;
63- protected internal readonly int NumModels ;
62+ private protected readonly ArgumentsBase Args ;
63+ private protected readonly int NumModels ;
6464
6565 /// <summary> Ensemble members </summary>
66- protected internal readonly ITrainer < IPredictorProducing < TOutput > > [ ] Trainers ;
66+ private protected readonly ITrainer < IPredictorProducing < TOutput > > [ ] Trainers ;
6767
6868 private readonly ISubsetSelector _subsetSelector ;
69- protected internal ISubModelSelector < TOutput > SubModelSelector ;
70- protected internal IOutputCombiner < TOutput > Combiner ;
69+ private protected ISubModelSelector < TOutput > SubModelSelector ;
70+ private protected IOutputCombiner < TOutput > Combiner ;
7171
72- protected internal EnsembleTrainerBase ( ArgumentsBase args , IHostEnvironment env , string name )
72+ private protected EnsembleTrainerBase ( ArgumentsBase args , IHostEnvironment env , string name )
7373 : base ( env , name )
7474 {
7575 Args = args ;
@@ -133,7 +133,7 @@ private TPredictor TrainCore(IChannel ch, RoleMappedData data)
133133 validationDataSetProportion = Math . Max ( validationDataSetProportion , stackingTrainer . ValidationDatasetProportion ) ;
134134
135135 var needMetrics = Args . ShowMetrics || Combiner is IWeightedAverager ;
136- var Models = new List < FeatureSubsetModel < IPredictorProducing < TOutput > > > ( ) ;
136+ var models = new List < FeatureSubsetModel < IPredictorProducing < TOutput > > > ( ) ;
137137
138138 _subsetSelector . Initialize ( data , NumModels , Args . BatchSize , validationDataSetProportion ) ;
139139 int batchNumber = 1 ;
@@ -179,16 +179,16 @@ private TPredictor TrainCore(IChannel ch, RoleMappedData data)
179179 if ( stackingTrainer != null )
180180 stackingTrainer . Train ( modelsList , _subsetSelector . GetTestData ( null , batch ) , Host ) ;
181181
182- Models . AddRange ( modelsList ) ;
183- int modelSize = Utils . Size ( Models ) ;
182+ models . AddRange ( modelsList ) ;
183+ int modelSize = Utils . Size ( models ) ;
184184 if ( modelSize < Utils . Size ( Trainers ) )
185185 ch . Warning ( "{0} of {1} trainings failed." , Utils . Size ( Trainers ) - modelSize , Utils . Size ( Trainers ) ) ;
186186 ch . Check ( modelSize > 0 , "Ensemble training resulted in no valid models." ) ;
187187 }
188- return CreatePredictor ( Models ) ;
188+ return CreatePredictor ( models ) ;
189189 }
190190
191- protected internal abstract TPredictor CreatePredictor ( List < FeatureSubsetModel < IPredictorProducing < TOutput > > > models ) ;
191+ private protected abstract TPredictor CreatePredictor ( List < FeatureSubsetModel < IPredictorProducing < TOutput > > > models ) ;
192192
193193 private bool EnsureMinimumFeaturesSelected ( Subset subset )
194194 {
@@ -203,7 +203,7 @@ private bool EnsureMinimumFeaturesSelected(Subset subset)
203203 return false ;
204204 }
205205
206- protected internal virtual void PrintMetrics ( IChannel ch , List < FeatureSubsetModel < IPredictorProducing < TOutput > > > models )
206+ private protected virtual void PrintMetrics ( IChannel ch , List < FeatureSubsetModel < IPredictorProducing < TOutput > > > models )
207207 {
208208 // REVIEW: The formatting of this method is bizarre and seemingly not even self-consistent
209209 // w.r.t. its usage of |. Is this intentional?
@@ -216,7 +216,7 @@ protected internal virtual void PrintMetrics(IChannel ch, List<FeatureSubsetMode
216216 ch . Info ( "{0}{1}" , string . Join ( "" , model . Metrics . Select ( m => string . Format ( "| {0} |" , m . Value ) ) ) , model . Predictor . GetType ( ) . Name ) ;
217217 }
218218
219- protected internal static FeatureSubsetModel < T > [ ] CreateModels < T > ( List < FeatureSubsetModel < IPredictorProducing < TOutput > > > models ) where T : IPredictor
219+ private protected static FeatureSubsetModel < T > [ ] CreateModels < T > ( List < FeatureSubsetModel < IPredictorProducing < TOutput > > > models ) where T : IPredictor
220220 {
221221 var subsetModels = new FeatureSubsetModel < T > [ models . Count ] ;
222222 for ( int i = 0 ; i < models . Count ; i ++ )
0 commit comments