Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/04/17 16:57:45 (7 years ago)
Author:
gkronber
Message:

#2650: merged r14769:14820 from trunk to branch to prepare for branch reintegration

Location:
branches/symbreg-factors-2650
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/symbreg-factors-2650

  • branches/symbreg-factors-2650/HeuristicLab.Algorithms.DataAnalysis

  • branches/symbreg-factors-2650/HeuristicLab.Algorithms.DataAnalysis/3.4/CrossValidation.cs

    r14185 r14825  
    451451      var aggregatedResults = new List<IResult>();
    452452      foreach (KeyValuePair<string, List<IClassificationSolution>> solutions in resultSolutions) {
    453         // clone manually to correctly clone references between cloned root objects
    454         Cloner cloner = new Cloner();
    455         var problemDataClone = (IClassificationProblemData)cloner.Clone(Problem.ProblemData);
     453        // at least one algorithm (GBT with logistic regression loss) produces a classification solution even though the original problem is a regression problem.
     454        var targetVariable = solutions.Value.First().ProblemData.TargetVariable;
     455        var problemDataClone = new ClassificationProblemData(Problem.ProblemData.Dataset,
     456          Problem.ProblemData.AllowedInputVariables, targetVariable);
    456457        // set partitions of problem data clone correctly
    457458        problemDataClone.TrainingPartition.Start = SamplesStart.Value; problemDataClone.TrainingPartition.End = SamplesEnd.Value;
  • branches/symbreg-factors-2650/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/GradientBoostedTreesAlgorithm.cs

    r14542 r14825  
    255255          var classificationProblemData = new ClassificationProblemData(problemData.Dataset,
    256256            problemData.AllowedInputVariables, problemData.TargetVariable, problemData.Transformations);
    257           classificationModel.RecalculateModelParameters(classificationProblemData, classificationProblemData.TrainingIndices);
     257          classificationProblemData.TrainingPartition.Start = Problem.ProblemData.TrainingPartition.Start;
     258          classificationProblemData.TrainingPartition.End = Problem.ProblemData.TrainingPartition.End;
     259          classificationProblemData.TestPartition.Start = Problem.ProblemData.TestPartition.Start;
     260          classificationProblemData.TestPartition.End = Problem.ProblemData.TestPartition.End;
     261
     262          classificationModel.SetThresholdsAndClassValues(new double[] { double.NegativeInfinity, 0.0 }, new []{ 0.0, 1.0 });
     263
    258264
    259265          var classificationSolution = new DiscriminantFunctionClassificationSolution(classificationModel, classificationProblemData);
Note: See TracChangeset for help on using the changeset viewer.