@@ -746,13 +746,10 @@ private static bool NeedCalibration(IHostEnvironment env, IChannel ch, ICalibrat
746
746
/// <param name="trainer">The trainer used to train the predictor.</param>
747
747
/// <param name="predictor">The predictor that needs calibration.</param>
748
748
/// <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>
752
749
/// <returns>The original predictor, if no calibration is needed,
753
750
/// or a metapredictor that wraps the original predictor and the newly trained calibrator.</returns>
754
751
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 )
756
753
{
757
754
Contracts . CheckValue ( env , nameof ( env ) ) ;
758
755
env . CheckValue ( ch , nameof ( ch ) ) ;
@@ -763,7 +760,7 @@ public static IPredictor TrainCalibratorIfNeeded(IHostEnvironment env, IChannel
763
760
if ( ! NeedCalibration ( env , ch , calibrator , trainer , predictor , data . Schema ) )
764
761
return predictor ;
765
762
766
- return TrainCalibrator ( env , ch , calibrator , maxRows , predictor , data , needValueMapper ) ;
763
+ return TrainCalibrator ( env , ch , calibrator , maxRows , predictor , data ) ;
767
764
}
768
765
769
766
/// <summary>
@@ -775,13 +772,10 @@ public static IPredictor TrainCalibratorIfNeeded(IHostEnvironment env, IChannel
775
772
/// <param name="maxRows">The maximum rows to use for calibrator training.</param>
776
773
/// <param name="predictor">The predictor that needs calibration.</param>
777
774
/// <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>
781
775
/// <returns>The original predictor, if no calibration is needed,
782
776
/// or a metapredictor that wraps the original predictor and the newly trained calibrator.</returns>
783
777
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 )
785
779
{
786
780
Contracts . CheckValue ( env , nameof ( env ) ) ;
787
781
env . CheckValue ( ch , nameof ( ch ) ) ;
@@ -834,10 +828,10 @@ public static IPredictor TrainCalibrator(IHostEnvironment env, IChannel ch, ICal
834
828
}
835
829
}
836
830
var cali = caliTrainer . FinishTraining ( ch ) ;
837
- return CreateCalibratedPredictor ( env , ( IPredictorProducing < Float > ) predictor , cali , needValueMapper ) ;
831
+ return CreateCalibratedPredictor ( env , ( IPredictorProducing < Float > ) predictor , cali ) ;
838
832
}
839
833
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 )
841
835
{
842
836
Contracts . Assert ( predictor != null ) ;
843
837
if ( cali == null )
@@ -853,7 +847,7 @@ public static IPredictorProducing<Float> CreateCalibratedPredictor(IHostEnvironm
853
847
var predWithFeatureScores = predictor as IPredictorWithFeatureWeights < Float > ;
854
848
if ( predWithFeatureScores != null && predictor is IParameterMixer < Float > && cali is IParameterMixer )
855
849
return new ParameterMixingCalibratedPredictor ( env , predWithFeatureScores , cali ) ;
856
- if ( needValueMapper )
850
+ if ( predictor is IValueMapper )
857
851
return new CalibratedPredictor ( env , predictor , cali ) ;
858
852
return new SchemaBindableCalibratedPredictor ( env , predictor , cali ) ;
859
853
}
0 commit comments