@@ -42,7 +42,7 @@ public static Scalar<float> LightGbm(this RegressionCatalog.RegressionTrainers c
4242 int ? numberOfLeaves = null ,
4343 int ? minimumExampleCountPerLeaf = null ,
4444 double ? learningRate = null ,
45- int numberOfIterations = Options . Defaults . NumberOfIterations ,
45+ int numberOfIterations = Defaults . NumberOfIterations ,
4646 Action < LightGbmRegressionModelParameters > onFit = null )
4747 {
4848 CheckUserValues ( label , features , weights , numberOfLeaves , minimumExampleCountPerLeaf , learningRate , numberOfIterations , onFit ) ;
@@ -76,10 +76,11 @@ public static Scalar<float> LightGbm(this RegressionCatalog.RegressionTrainers c
7676 /// <returns>The Score output column indicating the predicted value.</returns>
7777 public static Scalar < float > LightGbm ( this RegressionCatalog . RegressionTrainers catalog ,
7878 Scalar < float > label , Vector < float > features , Scalar < float > weights ,
79- Options options ,
79+ LightGbmRegressionTrainer . Options options ,
8080 Action < LightGbmRegressionModelParameters > onFit = null )
8181 {
82- CheckUserValues ( label , features , weights , options , onFit ) ;
82+ Contracts . CheckValue ( options , nameof ( options ) ) ;
83+ CheckUserValues ( label , features , weights , onFit ) ;
8384
8485 var rec = new TrainerEstimatorReconciler . Regression (
8586 ( env , labelName , featuresName , weightsName ) =>
@@ -128,7 +129,7 @@ public static (Scalar<float> score, Scalar<float> probability, Scalar<bool> pred
128129 int ? numberOfLeaves = null ,
129130 int ? minimumExampleCountPerLeaf = null ,
130131 double ? learningRate = null ,
131- int numberOfIterations = Options . Defaults . NumberOfIterations ,
132+ int numberOfIterations = Defaults . NumberOfIterations ,
132133 Action < CalibratedModelParametersBase < LightGbmBinaryModelParameters , PlattCalibrator > > onFit = null )
133134 {
134135 CheckUserValues ( label , features , weights , numberOfLeaves , minimumExampleCountPerLeaf , learningRate , numberOfIterations , onFit ) ;
@@ -165,10 +166,11 @@ public static (Scalar<float> score, Scalar<float> probability, Scalar<bool> pred
165166 /// from negative to positive infinity), the calibrated prediction (from 0 to 1), and the predicted label.</returns>
166167 public static ( Scalar < float > score , Scalar < float > probability , Scalar < bool > predictedLabel ) LightGbm ( this BinaryClassificationCatalog . BinaryClassificationTrainers catalog ,
167168 Scalar < bool > label , Vector < float > features , Scalar < float > weights ,
168- Options options ,
169+ LightGbmBinaryTrainer . Options options ,
169170 Action < CalibratedModelParametersBase < LightGbmBinaryModelParameters , PlattCalibrator > > onFit = null )
170171 {
171- CheckUserValues ( label , features , weights , options , onFit ) ;
172+ Contracts . CheckValue ( options , nameof ( options ) ) ;
173+ CheckUserValues ( label , features , weights , onFit ) ;
172174
173175 var rec = new TrainerEstimatorReconciler . BinaryClassifier (
174176 ( env , labelName , featuresName , weightsName ) =>
@@ -215,7 +217,7 @@ public static Scalar<float> LightGbm<TVal>(this RankingCatalog.RankingTrainers c
215217 int ? numberOfLeaves = null ,
216218 int ? minimumExampleCountPerLeaf = null ,
217219 double ? learningRate = null ,
218- int numberOfIterations = Options . Defaults . NumberOfIterations ,
220+ int numberOfIterations = Defaults . NumberOfIterations ,
219221 Action < LightGbmRankingModelParameters > onFit = null )
220222 {
221223 CheckUserValues ( label , features , weights , numberOfLeaves , minimumExampleCountPerLeaf , learningRate , numberOfIterations , onFit ) ;
@@ -253,10 +255,11 @@ public static Scalar<float> LightGbm<TVal>(this RankingCatalog.RankingTrainers c
253255 /// from negative to positive infinity), the calibrated prediction (from 0 to 1), and the predicted label.</returns>
254256 public static Scalar < float > LightGbm < TVal > ( this RankingCatalog . RankingTrainers catalog ,
255257 Scalar < float > label , Vector < float > features , Key < uint , TVal > groupId , Scalar < float > weights ,
256- Options options ,
258+ LightGbmRankingTrainer . Options options ,
257259 Action < LightGbmRankingModelParameters > onFit = null )
258260 {
259- CheckUserValues ( label , features , weights , options , onFit ) ;
261+ Contracts . CheckValue ( options , nameof ( options ) ) ;
262+ CheckUserValues ( label , features , weights , onFit ) ;
260263 Contracts . CheckValue ( groupId , nameof ( groupId ) ) ;
261264
262265 var rec = new TrainerEstimatorReconciler . Ranker < TVal > (
@@ -309,7 +312,7 @@ public static (Vector<float> score, Key<uint, TVal> predictedLabel)
309312 int ? numberOfLeaves = null ,
310313 int ? minimumExampleCountPerLeaf = null ,
311314 double ? learningRate = null ,
312- int numberOfIterations = Options . Defaults . NumberOfIterations ,
315+ int numberOfIterations = Defaults . NumberOfIterations ,
313316 Action < OneVersusAllModelParameters > onFit = null )
314317 {
315318 CheckUserValues ( label , features , weights , numberOfLeaves , minimumExampleCountPerLeaf , learningRate , numberOfIterations , onFit ) ;
@@ -347,10 +350,11 @@ public static (Vector<float> score, Key<uint, TVal> predictedLabel)
347350 Key < uint , TVal > label ,
348351 Vector < float > features ,
349352 Scalar < float > weights ,
350- Options options ,
353+ LightGbmMulticlassTrainer . Options options ,
351354 Action < OneVersusAllModelParameters > onFit = null )
352355 {
353- CheckUserValues ( label , features , weights , options , onFit ) ;
356+ Contracts . CheckValue ( options , nameof ( options ) ) ;
357+ CheckUserValues ( label , features , weights , onFit ) ;
354358
355359 var rec = new TrainerEstimatorReconciler . MulticlassClassificationReconciler < TVal > (
356360 ( env , labelName , featuresName , weightsName ) =>
@@ -386,14 +390,11 @@ private static void CheckUserValues(PipelineColumn label, Vector<float> features
386390 Contracts . CheckValueOrNull ( onFit ) ;
387391 }
388392
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 )
392394 {
393395 Contracts . CheckValue ( label , nameof ( label ) ) ;
394396 Contracts . CheckValue ( features , nameof ( features ) ) ;
395397 Contracts . CheckValueOrNull ( weights ) ;
396- Contracts . CheckValue ( options , nameof ( options ) ) ;
397398 Contracts . CheckValueOrNull ( onFit ) ;
398399 }
399400 }
0 commit comments