@@ -746,13 +746,10 @@ private static bool NeedCalibration(IHostEnvironment env, IChannel ch, ICalibrat
746746 /// <param name="trainer">The trainer used to train the predictor.</param>
747747 /// <param name="predictor">The predictor that needs calibration.</param>
748748 /// <param name="data">The examples to used for calibrator training.</param>
749- /// <param name="needValueMapper">Indicates whether the predictor returned needs to be an <see cref="IValueMapper"/>.
750- /// This parameter is needed for OVA that uses the predictors as <see cref="IValueMapper"/>s. If it is false,
751- /// The predictor returned is an an <see cref="ISchemaBindableMapper"/>.</param>
752749 /// <returns>The original predictor, if no calibration is needed,
753750 /// or a metapredictor that wraps the original predictor and the newly trained calibrator.</returns>
754751 public static IPredictor TrainCalibratorIfNeeded ( IHostEnvironment env , IChannel ch , ICalibratorTrainer calibrator ,
755- int maxRows , ITrainer trainer , IPredictor predictor , RoleMappedData data , bool needValueMapper = false )
752+ int maxRows , ITrainer trainer , IPredictor predictor , RoleMappedData data )
756753 {
757754 Contracts . CheckValue ( env , nameof ( env ) ) ;
758755 env . CheckValue ( ch , nameof ( ch ) ) ;
@@ -763,7 +760,7 @@ public static IPredictor TrainCalibratorIfNeeded(IHostEnvironment env, IChannel
763760 if ( ! NeedCalibration ( env , ch , calibrator , trainer , predictor , data . Schema ) )
764761 return predictor ;
765762
766- return TrainCalibrator ( env , ch , calibrator , maxRows , predictor , data , needValueMapper ) ;
763+ return TrainCalibrator ( env , ch , calibrator , maxRows , predictor , data ) ;
767764 }
768765
769766 /// <summary>
@@ -775,13 +772,10 @@ public static IPredictor TrainCalibratorIfNeeded(IHostEnvironment env, IChannel
775772 /// <param name="maxRows">The maximum rows to use for calibrator training.</param>
776773 /// <param name="predictor">The predictor that needs calibration.</param>
777774 /// <param name="data">The examples to used for calibrator training.</param>
778- /// <param name="needValueMapper">Indicates whether the predictor returned needs to be an <see cref="IValueMapper"/>.
779- /// This parameter is needed for OVA that uses the predictors as <see cref="IValueMapper"/>s. If it is false,
780- /// The predictor returned is an an <see cref="ISchemaBindableMapper"/>.</param>
781775 /// <returns>The original predictor, if no calibration is needed,
782776 /// or a metapredictor that wraps the original predictor and the newly trained calibrator.</returns>
783777 public static IPredictor TrainCalibrator ( IHostEnvironment env , IChannel ch , ICalibratorTrainer caliTrainer ,
784- int maxRows , IPredictor predictor , RoleMappedData data , bool needValueMapper = false )
778+ int maxRows , IPredictor predictor , RoleMappedData data )
785779 {
786780 Contracts . CheckValue ( env , nameof ( env ) ) ;
787781 env . CheckValue ( ch , nameof ( ch ) ) ;
@@ -834,10 +828,10 @@ public static IPredictor TrainCalibrator(IHostEnvironment env, IChannel ch, ICal
834828 }
835829 }
836830 var cali = caliTrainer . FinishTraining ( ch ) ;
837- return CreateCalibratedPredictor ( env , ( IPredictorProducing < Float > ) predictor , cali , needValueMapper ) ;
831+ return CreateCalibratedPredictor ( env , ( IPredictorProducing < Float > ) predictor , cali ) ;
838832 }
839833
840- public static IPredictorProducing < Float > CreateCalibratedPredictor ( IHostEnvironment env , IPredictorProducing < Float > predictor , ICalibrator cali , bool needValueMapper = false )
834+ public static IPredictorProducing < Float > CreateCalibratedPredictor ( IHostEnvironment env , IPredictorProducing < Float > predictor , ICalibrator cali )
841835 {
842836 Contracts . Assert ( predictor != null ) ;
843837 if ( cali == null )
@@ -853,7 +847,7 @@ public static IPredictorProducing<Float> CreateCalibratedPredictor(IHostEnvironm
853847 var predWithFeatureScores = predictor as IPredictorWithFeatureWeights < Float > ;
854848 if ( predWithFeatureScores != null && predictor is IParameterMixer < Float > && cali is IParameterMixer )
855849 return new ParameterMixingCalibratedPredictor ( env , predWithFeatureScores , cali ) ;
856- if ( needValueMapper )
850+ if ( predictor is IValueMapper )
857851 return new CalibratedPredictor ( env , predictor , cali ) ;
858852 return new SchemaBindableCalibratedPredictor ( env , predictor , cali ) ;
859853 }
0 commit comments