@@ -42,7 +42,7 @@ public static Scalar<float> LightGbm(this RegressionCatalog.RegressionTrainers c
42
42
int ? numberOfLeaves = null ,
43
43
int ? minimumExampleCountPerLeaf = null ,
44
44
double ? learningRate = null ,
45
- int numberOfIterations = Options . Defaults . NumberOfIterations ,
45
+ int numberOfIterations = Defaults . NumberOfIterations ,
46
46
Action < LightGbmRegressionModelParameters > onFit = null )
47
47
{
48
48
CheckUserValues ( label , features , weights , numberOfLeaves , minimumExampleCountPerLeaf , learningRate , numberOfIterations , onFit ) ;
@@ -76,10 +76,11 @@ public static Scalar<float> LightGbm(this RegressionCatalog.RegressionTrainers c
76
76
/// <returns>The Score output column indicating the predicted value.</returns>
77
77
public static Scalar < float > LightGbm ( this RegressionCatalog . RegressionTrainers catalog ,
78
78
Scalar < float > label , Vector < float > features , Scalar < float > weights ,
79
- Options options ,
79
+ LightGbmRegressionTrainer . Options options ,
80
80
Action < LightGbmRegressionModelParameters > onFit = null )
81
81
{
82
- CheckUserValues ( label , features , weights , options , onFit ) ;
82
+ Contracts . CheckValue ( options , nameof ( options ) ) ;
83
+ CheckUserValues ( label , features , weights , onFit ) ;
83
84
84
85
var rec = new TrainerEstimatorReconciler . Regression (
85
86
( env , labelName , featuresName , weightsName ) =>
@@ -128,7 +129,7 @@ public static (Scalar<float> score, Scalar<float> probability, Scalar<bool> pred
128
129
int ? numberOfLeaves = null ,
129
130
int ? minimumExampleCountPerLeaf = null ,
130
131
double ? learningRate = null ,
131
- int numberOfIterations = Options . Defaults . NumberOfIterations ,
132
+ int numberOfIterations = Defaults . NumberOfIterations ,
132
133
Action < CalibratedModelParametersBase < LightGbmBinaryModelParameters , PlattCalibrator > > onFit = null )
133
134
{
134
135
CheckUserValues ( label , features , weights , numberOfLeaves , minimumExampleCountPerLeaf , learningRate , numberOfIterations , onFit ) ;
@@ -165,10 +166,11 @@ public static (Scalar<float> score, Scalar<float> probability, Scalar<bool> pred
165
166
/// from negative to positive infinity), the calibrated prediction (from 0 to 1), and the predicted label.</returns>
166
167
public static ( Scalar < float > score , Scalar < float > probability , Scalar < bool > predictedLabel ) LightGbm ( this BinaryClassificationCatalog . BinaryClassificationTrainers catalog ,
167
168
Scalar < bool > label , Vector < float > features , Scalar < float > weights ,
168
- Options options ,
169
+ LightGbmBinaryTrainer . Options options ,
169
170
Action < CalibratedModelParametersBase < LightGbmBinaryModelParameters , PlattCalibrator > > onFit = null )
170
171
{
171
- CheckUserValues ( label , features , weights , options , onFit ) ;
172
+ Contracts . CheckValue ( options , nameof ( options ) ) ;
173
+ CheckUserValues ( label , features , weights , onFit ) ;
172
174
173
175
var rec = new TrainerEstimatorReconciler . BinaryClassifier (
174
176
( env , labelName , featuresName , weightsName ) =>
@@ -215,7 +217,7 @@ public static Scalar<float> LightGbm<TVal>(this RankingCatalog.RankingTrainers c
215
217
int ? numberOfLeaves = null ,
216
218
int ? minimumExampleCountPerLeaf = null ,
217
219
double ? learningRate = null ,
218
- int numberOfIterations = Options . Defaults . NumberOfIterations ,
220
+ int numberOfIterations = Defaults . NumberOfIterations ,
219
221
Action < LightGbmRankingModelParameters > onFit = null )
220
222
{
221
223
CheckUserValues ( label , features , weights , numberOfLeaves , minimumExampleCountPerLeaf , learningRate , numberOfIterations , onFit ) ;
@@ -253,10 +255,11 @@ public static Scalar<float> LightGbm<TVal>(this RankingCatalog.RankingTrainers c
253
255
/// from negative to positive infinity), the calibrated prediction (from 0 to 1), and the predicted label.</returns>
254
256
public static Scalar < float > LightGbm < TVal > ( this RankingCatalog . RankingTrainers catalog ,
255
257
Scalar < float > label , Vector < float > features , Key < uint , TVal > groupId , Scalar < float > weights ,
256
- Options options ,
258
+ LightGbmRankingTrainer . Options options ,
257
259
Action < LightGbmRankingModelParameters > onFit = null )
258
260
{
259
- CheckUserValues ( label , features , weights , options , onFit ) ;
261
+ Contracts . CheckValue ( options , nameof ( options ) ) ;
262
+ CheckUserValues ( label , features , weights , onFit ) ;
260
263
Contracts . CheckValue ( groupId , nameof ( groupId ) ) ;
261
264
262
265
var rec = new TrainerEstimatorReconciler . Ranker < TVal > (
@@ -309,7 +312,7 @@ public static (Vector<float> score, Key<uint, TVal> predictedLabel)
309
312
int ? numberOfLeaves = null ,
310
313
int ? minimumExampleCountPerLeaf = null ,
311
314
double ? learningRate = null ,
312
- int numberOfIterations = Options . Defaults . NumberOfIterations ,
315
+ int numberOfIterations = Defaults . NumberOfIterations ,
313
316
Action < OneVersusAllModelParameters > onFit = null )
314
317
{
315
318
CheckUserValues ( label , features , weights , numberOfLeaves , minimumExampleCountPerLeaf , learningRate , numberOfIterations , onFit ) ;
@@ -347,10 +350,11 @@ public static (Vector<float> score, Key<uint, TVal> predictedLabel)
347
350
Key < uint , TVal > label ,
348
351
Vector < float > features ,
349
352
Scalar < float > weights ,
350
- Options options ,
353
+ LightGbmMulticlassTrainer . Options options ,
351
354
Action < OneVersusAllModelParameters > onFit = null )
352
355
{
353
- CheckUserValues ( label , features , weights , options , onFit ) ;
356
+ Contracts . CheckValue ( options , nameof ( options ) ) ;
357
+ CheckUserValues ( label , features , weights , onFit ) ;
354
358
355
359
var rec = new TrainerEstimatorReconciler . MulticlassClassificationReconciler < TVal > (
356
360
( env , labelName , featuresName , weightsName ) =>
@@ -386,14 +390,11 @@ private static void CheckUserValues(PipelineColumn label, Vector<float> features
386
390
Contracts . CheckValueOrNull ( onFit ) ;
387
391
}
388
392
389
- private static void CheckUserValues ( PipelineColumn label , Vector < float > features , Scalar < float > weights ,
390
- Options options ,
391
- Delegate onFit )
393
+ private static void CheckUserValues ( PipelineColumn label , Vector < float > features , Scalar < float > weights , Delegate onFit )
392
394
{
393
395
Contracts . CheckValue ( label , nameof ( label ) ) ;
394
396
Contracts . CheckValue ( features , nameof ( features ) ) ;
395
397
Contracts . CheckValueOrNull ( weights ) ;
396
- Contracts . CheckValue ( options , nameof ( options ) ) ;
397
398
Contracts . CheckValueOrNull ( onFit ) ;
398
399
}
399
400
}
0 commit comments