Changeset 12611
- Timestamp:
- 07/06/15 15:56:59 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GBT-trunkintegration/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/GradientBoostedTreesAlgorithm.cs
r12591 r12611 232 232 233 233 // produce solution 234 if (CreateSolution) 235 Results.Add(new Result("Solution", new RegressionSolution(state.GetModel(), (IRegressionProblemData)problemData.Clone()))); 234 if (CreateSolution) { 235 // for logistic regression we produce a classification solution 236 if (lossFunction is LogisticRegressionLoss) { 237 var model = new DiscriminantFunctionClassificationModel(state.GetModel(), 238 new AccuracyMaximizationThresholdCalculator()); 239 var classificationProblemData = new ClassificationProblemData(problemData.Dataset, 240 problemData.AllowedInputVariables, problemData.TargetVariable, problemData.Transformations); 241 model.RecalculateModelParameters(classificationProblemData, classificationProblemData.TrainingIndices); 242 243 var classificationSolution = new DiscriminantFunctionClassificationSolution(model, classificationProblemData); 244 Results.Add(new Result("Solution (classification)", classificationSolution)); 245 } else { 246 // otherwise we produce a regression solution 247 Results.Add(new Result("Solution", new RegressionSolution(state.GetModel(), (IRegressionProblemData)problemData.Clone()))); 248 } 249 } 236 250 } 237 251 }
Note: See TracChangeset
for help on using the changeset viewer.