public void ReportFailTrial(TrialSettings settings, Exception exp) { var result = new BinaryClassificationTrialResult { TrialSettings = settings, Exception = exp, }; RunDetails.Add(result); }
private RunDetail <BinaryClassificationMetrics> ToRunDetail(BinaryClassificationTrialResult result) { var pipeline = result.TrialSettings.Pipeline; var trainerName = pipeline.ToString(); var parameter = result.TrialSettings.Parameter; var estimator = pipeline.BuildTrainingPipeline(Context, parameter); var modelContainer = new ModelContainer(Context, result.Model); return(new RunDetail <BinaryClassificationMetrics>(trainerName, estimator, null, modelContainer, result.BinaryClassificationMetrics, result.Exception)); }
public void ReportBestTrial(TrialResult result) { if (result is BinaryClassificationTrialResult binaryClassificationResult) { BestRun = binaryClassificationResult; } else { throw new ArgumentException($"result must be of type {typeof(BinaryClassificationTrialResult)}"); } }
private CrossValidationRunDetail <BinaryClassificationMetrics> ToCrossValidationRunDetail(BinaryClassificationTrialResult result) { var pipeline = result.TrialSettings.Pipeline; var trainerName = pipeline.ToString(); var parameter = result.TrialSettings.Parameter; var estimator = pipeline.BuildTrainingPipeline(Context, parameter); var crossValidationResult = result.CrossValidationMetrics.Select(m => new TrainResult <BinaryClassificationMetrics>(new ModelContainer(Context, m.Model), m.Metrics, result.Exception)); return(new CrossValidationRunDetail <BinaryClassificationMetrics>(trainerName, estimator, null, crossValidationResult)); }