Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/Microsoft.ML.Data/Prediction/Calibrator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -837,8 +837,9 @@ internal static object Create(IHostEnvironment env, ModelLoadContext ctx, object
[BestFriend]
internal static class CalibratorUtils
{
// maximum number of rows passed to the calibrator.
private const int _maxCalibrationExamples = 1000000;
// Maximum number of rows to process when training the Calibrator.
// If 0, we'll actually process the whole dataset.
private const int _maxCalibrationExamples = 0;

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

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