Skip to content

Commit 57be476

Browse files
Change the _maxCalibrationExamples default on CalibratorUtils (#5415)
* Change the _maxCalibrationExamples default * Improving comments
1 parent 5dbfd8a commit 57be476

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/Microsoft.ML.Data/Prediction/Calibrator.cs

+7-2
Original file line numberDiff line numberDiff line change
@@ -837,8 +837,9 @@ internal static object Create(IHostEnvironment env, ModelLoadContext ctx, object
837837
[BestFriend]
838838
internal static class CalibratorUtils
839839
{
840-
// maximum number of rows passed to the calibrator.
841-
private const int _maxCalibrationExamples = 1000000;
840+
// Maximum number of rows to process when training the Calibrator.
841+
// If 0, we'll actually process the whole dataset.
842+
private const int _maxCalibrationExamples = 0;
842843

843844
private static bool NeedCalibration(IHostEnvironment env, IChannel ch, ICalibratorTrainer calibrator,
844845
ITrainer trainer, IPredictor predictor, RoleMappedSchema schema)
@@ -988,6 +989,10 @@ public static ICalibrator TrainCalibrator(IHostEnvironment env, IChannel ch, ICa
988989
caliTrainer.ProcessTrainingExample(score, label > 0, weight);
989990

990991
if (maxRows > 0 && ++num >= maxRows)
992+
// If maxRows was 0, we'll process all of the rows in the dataset
993+
// Notice that depending on the calibrator, "processing" might mean
994+
// randomly choosing some of the "processed" rows
995+
// to actually train the calibrator.
991996
break;
992997
}
993998
}

0 commit comments

Comments
 (0)