@@ -45,7 +45,7 @@ public static Scalar<float> LightGbm(this RegressionCatalog.RegressionTrainers c
45
45
int ? numLeaves = null ,
46
46
int ? minDataPerLeaf = null ,
47
47
double ? learningRate = null ,
48
- int numBoostRound = LightGbmArguments . Defaults . NumBoostRound ,
48
+ int numBoostRound = Options . Defaults . NumBoostRound ,
49
49
Action < LightGbmRegressionModelParameters > onFit = null )
50
50
{
51
51
CheckUserValues ( label , features , weights , numLeaves , minDataPerLeaf , learningRate , numBoostRound , onFit ) ;
@@ -70,7 +70,7 @@ public static Scalar<float> LightGbm(this RegressionCatalog.RegressionTrainers c
70
70
/// <param name="label">The label column.</param>
71
71
/// <param name="features">The features column.</param>
72
72
/// <param name="weights">The weights column.</param>
73
- /// <param name="advancedSettings ">Algorithm advanced settings.</param>
73
+ /// <param name="options ">Algorithm advanced settings.</param>
74
74
/// <param name="onFit">A delegate that is called every time the
75
75
/// <see cref="Estimator{TInShape, TOutShape, TTransformer}.Fit(DataView{TInShape})"/> method is called on the
76
76
/// <see cref="Estimator{TInShape, TOutShape, TTransformer}"/> instance created out of this. This delegate will receive
@@ -79,19 +79,19 @@ public static Scalar<float> LightGbm(this RegressionCatalog.RegressionTrainers c
79
79
/// <returns>The Score output column indicating the predicted value.</returns>
80
80
public static Scalar < float > LightGbm ( this RegressionCatalog . RegressionTrainers catalog ,
81
81
Scalar < float > label , Vector < float > features , Scalar < float > weights ,
82
- LightGbmArguments advancedSettings ,
82
+ Options options ,
83
83
Action < LightGbmRegressionModelParameters > onFit = null )
84
84
{
85
- CheckUserValues ( label , features , weights , advancedSettings , onFit ) ;
85
+ CheckUserValues ( label , features , weights , options , onFit ) ;
86
86
87
87
var rec = new TrainerEstimatorReconciler . Regression (
88
88
( env , labelName , featuresName , weightsName ) =>
89
89
{
90
- advancedSettings . LabelColumn = labelName ;
91
- advancedSettings . FeatureColumn = featuresName ;
92
- advancedSettings . WeightColumn = weightsName != null ? Optional < string > . Explicit ( weightsName ) : Optional < string > . Implicit ( DefaultColumnNames . Weight ) ;
90
+ options . LabelColumn = labelName ;
91
+ options . FeatureColumn = featuresName ;
92
+ options . WeightColumn = weightsName != null ? Optional < string > . Explicit ( weightsName ) : Optional < string > . Implicit ( DefaultColumnNames . Weight ) ;
93
93
94
- var trainer = new LightGbmRegressorTrainer ( env , advancedSettings ) ;
94
+ var trainer = new LightGbmRegressorTrainer ( env , options ) ;
95
95
if ( onFit != null )
96
96
return trainer . WithOnFitDelegate ( trans => onFit ( trans . Model ) ) ;
97
97
return trainer ;
@@ -129,7 +129,7 @@ public static (Scalar<float> score, Scalar<float> probability, Scalar<bool> pred
129
129
int ? numLeaves = null ,
130
130
int ? minDataPerLeaf = null ,
131
131
double ? learningRate = null ,
132
- int numBoostRound = LightGbmArguments . Defaults . NumBoostRound ,
132
+ int numBoostRound = Options . Defaults . NumBoostRound ,
133
133
Action < IPredictorWithFeatureWeights < float > > onFit = null )
134
134
{
135
135
CheckUserValues ( label , features , weights , numLeaves , minDataPerLeaf , learningRate , numBoostRound , onFit ) ;
@@ -156,7 +156,7 @@ public static (Scalar<float> score, Scalar<float> probability, Scalar<bool> pred
156
156
/// <param name="label">The label column.</param>
157
157
/// <param name="features">The features column.</param>
158
158
/// <param name="weights">The weights column.</param>
159
- /// <param name="advancedSettings ">Algorithm advanced settings.</param>
159
+ /// <param name="options ">Algorithm advanced settings.</param>
160
160
/// <param name="onFit">A delegate that is called every time the
161
161
/// <see cref="Estimator{TInShape, TOutShape, TTransformer}.Fit(DataView{TInShape})"/> method is called on the
162
162
/// <see cref="Estimator{TInShape, TOutShape, TTransformer}"/> instance created out of this. This delegate will receive
@@ -166,19 +166,19 @@ public static (Scalar<float> score, Scalar<float> probability, Scalar<bool> pred
166
166
/// from negative to positive infinity), the calibrated prediction (from 0 to 1), and the predicted label.</returns>
167
167
public static ( Scalar < float > score , Scalar < float > probability , Scalar < bool > predictedLabel ) LightGbm ( this BinaryClassificationCatalog . BinaryClassificationTrainers catalog ,
168
168
Scalar < bool > label , Vector < float > features , Scalar < float > weights ,
169
- LightGbmArguments advancedSettings ,
169
+ Options options ,
170
170
Action < IPredictorWithFeatureWeights < float > > onFit = null )
171
171
{
172
- CheckUserValues ( label , features , weights , advancedSettings , onFit ) ;
172
+ CheckUserValues ( label , features , weights , options , onFit ) ;
173
173
174
174
var rec = new TrainerEstimatorReconciler . BinaryClassifier (
175
175
( env , labelName , featuresName , weightsName ) =>
176
176
{
177
- advancedSettings . LabelColumn = labelName ;
178
- advancedSettings . FeatureColumn = featuresName ;
179
- advancedSettings . WeightColumn = weightsName != null ? Optional < string > . Explicit ( weightsName ) : Optional < string > . Implicit ( DefaultColumnNames . Weight ) ;
177
+ options . LabelColumn = labelName ;
178
+ options . FeatureColumn = featuresName ;
179
+ options . WeightColumn = weightsName != null ? Optional < string > . Explicit ( weightsName ) : Optional < string > . Implicit ( DefaultColumnNames . Weight ) ;
180
180
181
- var trainer = new LightGbmBinaryTrainer ( env , advancedSettings ) ;
181
+ var trainer = new LightGbmBinaryTrainer ( env , options ) ;
182
182
183
183
if ( onFit != null )
184
184
return trainer . WithOnFitDelegate ( trans => onFit ( trans . Model ) ) ;
@@ -213,7 +213,7 @@ public static Scalar<float> LightGbm<TVal>(this RankingCatalog.RankingTrainers c
213
213
int ? numLeaves = null ,
214
214
int ? minDataPerLeaf = null ,
215
215
double ? learningRate = null ,
216
- int numBoostRound = LightGbmArguments . Defaults . NumBoostRound ,
216
+ int numBoostRound = Options . Defaults . NumBoostRound ,
217
217
Action < LightGbmRankingModelParameters > onFit = null )
218
218
{
219
219
CheckUserValues ( label , features , weights , numLeaves , minDataPerLeaf , learningRate , numBoostRound , onFit ) ;
@@ -241,7 +241,7 @@ public static Scalar<float> LightGbm<TVal>(this RankingCatalog.RankingTrainers c
241
241
/// <param name="features">The features column.</param>
242
242
/// <param name="groupId">The groupId column.</param>
243
243
/// <param name="weights">The weights column.</param>
244
- /// <param name="advancedSettings ">Algorithm advanced settings.</param>
244
+ /// <param name="options ">Algorithm advanced settings.</param>
245
245
/// <param name="onFit">A delegate that is called every time the
246
246
/// <see cref="Estimator{TInShape, TOutShape, TTransformer}.Fit(DataView{TInShape})"/> method is called on the
247
247
/// <see cref="Estimator{TInShape, TOutShape, TTransformer}"/> instance created out of this. This delegate will receive
@@ -251,21 +251,21 @@ public static Scalar<float> LightGbm<TVal>(this RankingCatalog.RankingTrainers c
251
251
/// from negative to positive infinity), the calibrated prediction (from 0 to 1), and the predicted label.</returns>
252
252
public static Scalar < float > LightGbm < TVal > ( this RankingCatalog . RankingTrainers catalog ,
253
253
Scalar < float > label , Vector < float > features , Key < uint , TVal > groupId , Scalar < float > weights ,
254
- LightGbmArguments advancedSettings ,
254
+ Options options ,
255
255
Action < LightGbmRankingModelParameters > onFit = null )
256
256
{
257
- CheckUserValues ( label , features , weights , advancedSettings , onFit ) ;
257
+ CheckUserValues ( label , features , weights , options , onFit ) ;
258
258
Contracts . CheckValue ( groupId , nameof ( groupId ) ) ;
259
259
260
260
var rec = new TrainerEstimatorReconciler . Ranker < TVal > (
261
261
( env , labelName , featuresName , groupIdName , weightsName ) =>
262
262
{
263
- advancedSettings . LabelColumn = labelName ;
264
- advancedSettings . FeatureColumn = featuresName ;
265
- advancedSettings . GroupIdColumn = groupIdName ;
266
- advancedSettings . WeightColumn = weightsName != null ? Optional < string > . Explicit ( weightsName ) : Optional < string > . Implicit ( DefaultColumnNames . Weight ) ;
263
+ options . LabelColumn = labelName ;
264
+ options . FeatureColumn = featuresName ;
265
+ options . GroupIdColumn = groupIdName ;
266
+ options . WeightColumn = weightsName != null ? Optional < string > . Explicit ( weightsName ) : Optional < string > . Implicit ( DefaultColumnNames . Weight ) ;
267
267
268
- var trainer = new LightGbmRankingTrainer ( env , advancedSettings ) ;
268
+ var trainer = new LightGbmRankingTrainer ( env , options ) ;
269
269
270
270
if ( onFit != null )
271
271
return trainer . WithOnFitDelegate ( trans => onFit ( trans . Model ) ) ;
@@ -307,7 +307,7 @@ public static (Vector<float> score, Key<uint, TVal> predictedLabel)
307
307
int ? numLeaves = null ,
308
308
int ? minDataPerLeaf = null ,
309
309
double ? learningRate = null ,
310
- int numBoostRound = LightGbmArguments . Defaults . NumBoostRound ,
310
+ int numBoostRound = Options . Defaults . NumBoostRound ,
311
311
Action < OvaModelParameters > onFit = null )
312
312
{
313
313
CheckUserValues ( label , features , weights , numLeaves , minDataPerLeaf , learningRate , numBoostRound , onFit ) ;
@@ -333,7 +333,7 @@ public static (Vector<float> score, Key<uint, TVal> predictedLabel)
333
333
/// <param name="label">The label, or dependent variable.</param>
334
334
/// <param name="features">The features, or independent variables.</param>
335
335
/// <param name="weights">The weights column.</param>
336
- /// <param name="advancedSettings ">Advanced options to the algorithm.</param>
336
+ /// <param name="options ">Advanced options to the algorithm.</param>
337
337
/// <param name="onFit">A delegate that is called every time the
338
338
/// <see cref="Estimator{TInShape, TOutShape, TTransformer}.Fit(DataView{TInShape})"/> method is called on the
339
339
/// <see cref="Estimator{TInShape, TOutShape, TTransformer}"/> instance created out of this. This delegate will receive
@@ -345,19 +345,19 @@ public static (Vector<float> score, Key<uint, TVal> predictedLabel)
345
345
Key < uint , TVal > label ,
346
346
Vector < float > features ,
347
347
Scalar < float > weights ,
348
- LightGbmArguments advancedSettings ,
348
+ Options options ,
349
349
Action < OvaModelParameters > onFit = null )
350
350
{
351
- CheckUserValues ( label , features , weights , advancedSettings , onFit ) ;
351
+ CheckUserValues ( label , features , weights , options , onFit ) ;
352
352
353
353
var rec = new TrainerEstimatorReconciler . MulticlassClassifier < TVal > (
354
354
( env , labelName , featuresName , weightsName ) =>
355
355
{
356
- advancedSettings . LabelColumn = labelName ;
357
- advancedSettings . FeatureColumn = featuresName ;
358
- advancedSettings . WeightColumn = weightsName != null ? Optional < string > . Explicit ( weightsName ) : Optional < string > . Implicit ( DefaultColumnNames . Weight ) ;
356
+ options . LabelColumn = labelName ;
357
+ options . FeatureColumn = featuresName ;
358
+ options . WeightColumn = weightsName != null ? Optional < string > . Explicit ( weightsName ) : Optional < string > . Implicit ( DefaultColumnNames . Weight ) ;
359
359
360
- var trainer = new LightGbmMulticlassTrainer ( env , advancedSettings ) ;
360
+ var trainer = new LightGbmMulticlassTrainer ( env , options ) ;
361
361
362
362
if ( onFit != null )
363
363
return trainer . WithOnFitDelegate ( trans => onFit ( trans . Model ) ) ;
@@ -385,13 +385,13 @@ private static void CheckUserValues(PipelineColumn label, Vector<float> features
385
385
}
386
386
387
387
private static void CheckUserValues ( PipelineColumn label , Vector < float > features , Scalar < float > weights ,
388
- LightGbmArguments advancedSettings ,
388
+ Options options ,
389
389
Delegate onFit )
390
390
{
391
391
Contracts . CheckValue ( label , nameof ( label ) ) ;
392
392
Contracts . CheckValue ( features , nameof ( features ) ) ;
393
393
Contracts . CheckValueOrNull ( weights ) ;
394
- Contracts . CheckValue ( advancedSettings , nameof ( advancedSettings ) ) ;
394
+ Contracts . CheckValue ( options , nameof ( options ) ) ;
395
395
Contracts . CheckValueOrNull ( onFit ) ;
396
396
}
397
397
}
0 commit comments