Ignore:
Timestamp:
10/26/15 20:44:41 (5 years ago)
Author:
gkronber
Message:

#2450: marked constructor of GBTModel obsolete and wrapped GBTModels in GBTModelSurrogates where necessary in the API. Removed an internal unused method from the API.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/GradientBoostedTreesAlgorithm.cs

    r12873 r13065  
    255255      // produce solution
    256256      if (CreateSolution) {
    257         var surrogateModel = new GradientBoostedTreesModelSurrogate(problemData, (uint)Seed, lossFunction,
    258           Iterations, MaxSize, R, M, Nu, state.GetModel());
     257        var model = state.GetModel();
    259258
    260259        // for logistic regression we produce a classification solution
    261260        if (lossFunction is LogisticRegressionLoss) {
    262           var model = new DiscriminantFunctionClassificationModel(surrogateModel,
     261          var classificationModel = new DiscriminantFunctionClassificationModel(model,
    263262            new AccuracyMaximizationThresholdCalculator());
    264263          var classificationProblemData = new ClassificationProblemData(problemData.Dataset,
    265264            problemData.AllowedInputVariables, problemData.TargetVariable, problemData.Transformations);
    266           model.RecalculateModelParameters(classificationProblemData, classificationProblemData.TrainingIndices);
    267 
    268           var classificationSolution = new DiscriminantFunctionClassificationSolution(model, classificationProblemData);
     265          classificationModel.RecalculateModelParameters(classificationProblemData, classificationProblemData.TrainingIndices);
     266
     267          var classificationSolution = new DiscriminantFunctionClassificationSolution(classificationModel, classificationProblemData);
    269268          Results.Add(new Result("Solution", classificationSolution));
    270269        } else {
    271270          // otherwise we produce a regression solution
    272           Results.Add(new Result("Solution", new RegressionSolution(surrogateModel, problemData)));
     271          Results.Add(new Result("Solution", new RegressionSolution(model, problemData)));
    273272        }
    274273      }
Note: See TracChangeset for help on using the changeset viewer.