@@ -2985,7 +2985,7 @@ void ICanSaveInTextFormat.SaveAsText(TextWriter writer, RoleMappedSchema schema)
29852985 void ICanSaveInIniFormat . SaveAsIni ( TextWriter writer , RoleMappedSchema schema , ICalibrator calibrator )
29862986 {
29872987 Host . CheckValue ( writer , nameof ( writer ) ) ;
2988- var ensembleIni = FastTreeIniFormatUtils . TreeEnsembleToIni ( Host , TrainedEnsemble , schema , calibrator ,
2988+ var ensembleIni = FastTreeIniFileUtils . TreeEnsembleToIni ( Host , TrainedEnsemble , schema , calibrator ,
29892989 InnerArgs , appendFeatureGain : true , includeZeroGainFeatures : false ) ;
29902990 writer . WriteLine ( ensembleIni ) ;
29912991 }
@@ -3373,46 +3373,4 @@ public TreeNode(Dictionary<string, object> keyValues)
33733373 public Dictionary < string , object > KeyValues { get ; }
33743374 }
33753375 }
3376- internal static class FastTreeIniFormatUtils
3377- {
3378- public static string TreeEnsembleToIni (
3379- IHost host , TreeEnsemble ensemble , RoleMappedSchema schema , ICalibrator calibrator ,
3380- string trainingParams , bool appendFeatureGain , bool includeZeroGainFeatures )
3381- {
3382- host . CheckValue ( ensemble , nameof ( ensemble ) ) ;
3383- host . CheckValue ( schema , nameof ( schema ) ) ;
3384-
3385- string ensembleIni = ensemble . ToTreeEnsembleIni ( new FeaturesToContentMap ( schema ) ,
3386- trainingParams , appendFeatureGain , includeZeroGainFeatures ) ;
3387- ensembleIni = AddCalibrationToIni ( host , ensembleIni , calibrator ) ;
3388- return ensembleIni ;
3389- }
3390-
3391- /// <summary>
3392- /// Get the calibration summary in INI format
3393- /// </summary>
3394- private static string AddCalibrationToIni ( IHost host , string ini , ICalibrator calibrator )
3395- {
3396- host . AssertValue ( ini ) ;
3397- host . AssertValueOrNull ( calibrator ) ;
3398-
3399- if ( calibrator == null )
3400- return ini ;
3401-
3402- if ( calibrator is PlattCalibrator )
3403- {
3404- string calibratorEvaluatorIni = IniFileUtils . GetCalibratorEvaluatorIni ( ini , calibrator as PlattCalibrator ) ;
3405- return IniFileUtils . AddEvaluator ( ini , calibratorEvaluatorIni ) ;
3406- }
3407- else
3408- {
3409- StringBuilder newSection = new StringBuilder ( ) ;
3410- newSection . AppendLine ( ) ;
3411- newSection . AppendLine ( ) ;
3412- newSection . AppendLine ( "[TLCCalibration]" ) ;
3413- newSection . AppendLine ( "Type=" + calibrator . GetType ( ) . Name ) ;
3414- return ini + newSection ;
3415- }
3416- }
3417- }
34183376}
0 commit comments