@@ -1440,7 +1440,7 @@ internal override void Check(IHostEnvironment env)
1440
1440
/// <param name="l2Const">The L2 regularization hyperparameter.</param>
1441
1441
/// <param name="l1Threshold">The L1 regularization hyperparameter. Higher values will tend to lead to more sparse model.</param>
1442
1442
/// <param name="maxIterations">The maximum number of passes to perform over the data.</param>
1443
- protected SdcaBinaryTrainerBase ( IHostEnvironment env ,
1443
+ private protected SdcaBinaryTrainerBase ( IHostEnvironment env ,
1444
1444
string labelColumnName = DefaultColumnNames . Label ,
1445
1445
string featureColumnName = DefaultColumnNames . Features ,
1446
1446
string weightColumnName = null ,
@@ -1460,7 +1460,7 @@ protected SdcaBinaryTrainerBase(IHostEnvironment env,
1460
1460
_outputColumns = ComputeSdcaBinaryClassifierSchemaShape ( ) ;
1461
1461
}
1462
1462
1463
- protected SdcaBinaryTrainerBase ( IHostEnvironment env , BinaryArgumentBase options , ISupportSdcaClassificationLoss loss = null , bool doCalibration = false )
1463
+ private protected SdcaBinaryTrainerBase ( IHostEnvironment env , BinaryArgumentBase options , ISupportSdcaClassificationLoss loss = null , bool doCalibration = false )
1464
1464
: base ( env , options , TrainerUtils . MakeBoolScalarLabel ( options . LabelColumn ) )
1465
1465
{
1466
1466
_loss = loss ?? new LogLossFactory ( ) . CreateComponent ( env ) ;
@@ -1470,7 +1470,7 @@ protected SdcaBinaryTrainerBase(IHostEnvironment env, BinaryArgumentBase options
1470
1470
_outputColumns = ComputeSdcaBinaryClassifierSchemaShape ( ) ;
1471
1471
}
1472
1472
1473
- protected abstract SchemaShape . Column [ ] ComputeSdcaBinaryClassifierSchemaShape ( ) ;
1473
+ private protected abstract SchemaShape . Column [ ] ComputeSdcaBinaryClassifierSchemaShape ( ) ;
1474
1474
1475
1475
protected override void CheckLabelCompatible ( SchemaShape . Column labelCol )
1476
1476
{
@@ -1486,7 +1486,7 @@ protected override void CheckLabelCompatible(SchemaShape.Column labelCol)
1486
1486
error ( ) ;
1487
1487
}
1488
1488
1489
- protected LinearBinaryModelParameters CreateLinearBinaryModelParameters ( VBuffer < float > [ ] weights , float [ ] bias )
1489
+ private protected LinearBinaryModelParameters CreateLinearBinaryModelParameters ( VBuffer < float > [ ] weights , float [ ] bias )
1490
1490
{
1491
1491
Host . CheckParam ( Utils . Size ( weights ) == 1 , nameof ( weights ) ) ;
1492
1492
Host . CheckParam ( Utils . Size ( bias ) == 1 , nameof ( bias ) ) ;
@@ -1541,14 +1541,14 @@ internal SdcaBinaryTrainer(IHostEnvironment env, Options options)
1541
1541
{
1542
1542
}
1543
1543
1544
- protected override CalibratedModelParametersBase < LinearBinaryModelParameters , PlattCalibrator > CreatePredictor ( VBuffer < float > [ ] weights , float [ ] bias )
1544
+ private protected override CalibratedModelParametersBase < LinearBinaryModelParameters , PlattCalibrator > CreatePredictor ( VBuffer < float > [ ] weights , float [ ] bias )
1545
1545
{
1546
1546
var linearModel = CreateLinearBinaryModelParameters ( weights , bias ) ;
1547
1547
var calibrator = new PlattCalibrator ( Host , - 1 , 0 ) ;
1548
1548
return new ParameterMixingCalibratedModelParameters < LinearBinaryModelParameters , PlattCalibrator > ( Host , linearModel , calibrator ) ;
1549
1549
}
1550
1550
1551
- protected override SchemaShape . Column [ ] ComputeSdcaBinaryClassifierSchemaShape ( )
1551
+ private protected override SchemaShape . Column [ ] ComputeSdcaBinaryClassifierSchemaShape ( )
1552
1552
{
1553
1553
return new SchemaShape . Column [ ]
1554
1554
{
@@ -1603,7 +1603,7 @@ internal SdcaNonCalibratedBinaryTrainer(IHostEnvironment env, Options options)
1603
1603
{
1604
1604
}
1605
1605
1606
- protected override SchemaShape . Column [ ] ComputeSdcaBinaryClassifierSchemaShape ( )
1606
+ private protected override SchemaShape . Column [ ] ComputeSdcaBinaryClassifierSchemaShape ( )
1607
1607
{
1608
1608
return new SchemaShape . Column [ ]
1609
1609
{
@@ -1628,7 +1628,7 @@ protected override SchemaShape.Column[] ComputeSdcaBinaryClassifierSchemaShape()
1628
1628
/// <see cref="CreatePredictor"/> directly outputs a <see cref="LinearBinaryModelParameters"/> built from
1629
1629
/// the learned weights and bias without calibration.
1630
1630
/// </summary>
1631
- protected override LinearBinaryModelParameters CreatePredictor ( VBuffer < float > [ ] weights , float [ ] bias )
1631
+ private protected override LinearBinaryModelParameters CreatePredictor ( VBuffer < float > [ ] weights , float [ ] bias )
1632
1632
=> CreateLinearBinaryModelParameters ( weights , bias ) ;
1633
1633
}
1634
1634
@@ -1661,7 +1661,7 @@ internal LegacySdcaBinaryTrainer(IHostEnvironment env, Options options)
1661
1661
{
1662
1662
}
1663
1663
1664
- protected override SchemaShape . Column [ ] ComputeSdcaBinaryClassifierSchemaShape ( )
1664
+ private protected override SchemaShape . Column [ ] ComputeSdcaBinaryClassifierSchemaShape ( )
1665
1665
{
1666
1666
var outCols = new List < SchemaShape . Column > ( )
1667
1667
{
@@ -1786,7 +1786,7 @@ internal static class Defaults
1786
1786
1787
1787
private readonly OptionsBase _options ;
1788
1788
1789
- protected IClassificationLoss Loss { get ; }
1789
+ private protected IClassificationLoss Loss { get ; }
1790
1790
1791
1791
private protected override bool ShuffleData => _options . Shuffle ;
1792
1792
@@ -2053,12 +2053,12 @@ private protected override TModel TrainCore(IChannel ch, RoleMappedData data, Li
2053
2053
/// <param name="weights">Weights of linear model.</param>
2054
2054
/// <param name="bias">Bias of linear model.</param>
2055
2055
/// <returns>A model built upon weights and bias. It can be as simple as a <see cref="LinearBinaryModelParameters"/>.</returns>
2056
- protected abstract TModel CreateModel ( VBuffer < float > weights , float bias ) ;
2056
+ private protected abstract TModel CreateModel ( VBuffer < float > weights , float bias ) ;
2057
2057
2058
2058
/// <summary>
2059
2059
/// A helper function used to create <see cref="LinearBinaryModelParameters"/> in implementations of <see cref="CreateModel(VBuffer{float}, float)"/>.
2060
2060
/// </summary>
2061
- protected LinearBinaryModelParameters CreateLinearBinaryModelParameters ( VBuffer < float > weights , float bias )
2061
+ private protected LinearBinaryModelParameters CreateLinearBinaryModelParameters ( VBuffer < float > weights , float bias )
2062
2062
{
2063
2063
Host . CheckParam ( weights . Length > 0 , nameof ( weights ) ) ;
2064
2064
@@ -2127,7 +2127,7 @@ protected override SchemaShape.Column[] GetOutputColumnsCore(SchemaShape inputSc
2127
2127
/// Given weights and bias trained in <see cref="SgdBinaryTrainerBase{TModelParameters}.TrainCore(IChannel, RoleMappedData, LinearModelParameters, int)"/>,
2128
2128
/// <see cref="CreateModel(VBuffer{float}, float)"/> produces the final calibrated linear model.
2129
2129
/// </summary>
2130
- protected override CalibratedModelParametersBase < LinearBinaryModelParameters , PlattCalibrator > CreateModel ( VBuffer < float > weights , float bias )
2130
+ private protected override CalibratedModelParametersBase < LinearBinaryModelParameters , PlattCalibrator > CreateModel ( VBuffer < float > weights , float bias )
2131
2131
{
2132
2132
// SubModel, which is a linear function.
2133
2133
var subModel = CreateLinearBinaryModelParameters ( weights , bias ) ;
@@ -2182,7 +2182,7 @@ protected override SchemaShape.Column[] GetOutputColumnsCore(SchemaShape inputSc
2182
2182
} ;
2183
2183
}
2184
2184
2185
- protected override LinearBinaryModelParameters CreateModel ( VBuffer < float > weights , float bias )
2185
+ private protected override LinearBinaryModelParameters CreateModel ( VBuffer < float > weights , float bias )
2186
2186
=> CreateLinearBinaryModelParameters ( weights , bias ) ;
2187
2187
}
2188
2188
@@ -2237,7 +2237,7 @@ protected override SchemaShape.Column[] GetOutputColumnsCore(SchemaShape inputSc
2237
2237
} ;
2238
2238
}
2239
2239
2240
- protected override IPredictorWithFeatureWeights < float > CreateModel ( VBuffer < float > weights , float bias )
2240
+ private protected override IPredictorWithFeatureWeights < float > CreateModel ( VBuffer < float > weights , float bias )
2241
2241
{
2242
2242
if ( ! ( Loss is LogLoss ) )
2243
2243
return CreateLinearBinaryModelParameters ( weights , bias ) ;
0 commit comments