Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/19/16 19:56:11 (8 years ago)
Author:
bburlacu
Message:

#2604: Revert changes to DataAnalysisSolution and IDataAnalysisSolution and implement the desired properties in model classes that implement IDataAnalysisModel, IRegressionModel and IClassificationModel.

File:
1 edited

Legend:

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

    r13157 r13921  
    2222
    2323using System.Collections.Generic;
     24using System.Linq;
    2425using HeuristicLab.Common;
    2526using HeuristicLab.Core;
     
    5455    private int maxSize;
    5556
     57    public string TargetVariable {
     58      get { return trainingProblemData.TargetVariable; }
     59    }
     60
     61    public IEnumerable<string> VariablesUsedForPrediction {
     62      get { return actualModel.Models.SelectMany(x => x.VariablesUsedForPrediction).Distinct().OrderBy(x => x); }
     63    }
    5664
    5765    [StorableConstructor]
     
    7381
    7482    // create only the surrogate model without an actual model
    75     public GradientBoostedTreesModelSurrogate(IRegressionProblemData trainingProblemData, uint seed, ILossFunction lossFunction, int iterations, int maxSize, double r, double m, double nu)
     83    public GradientBoostedTreesModelSurrogate(IRegressionProblemData trainingProblemData, uint seed,
     84      ILossFunction lossFunction, int iterations, int maxSize, double r, double m, double nu)
    7685      : base("Gradient boosted tree model", string.Empty) {
    7786      this.trainingProblemData = trainingProblemData;
     
    8695
    8796    // wrap an actual model in a surrograte
    88     public GradientBoostedTreesModelSurrogate(IRegressionProblemData trainingProblemData, uint seed, ILossFunction lossFunction, int iterations, int maxSize, double r, double m, double nu, IGradientBoostedTreesModel model)
     97    public GradientBoostedTreesModelSurrogate(IRegressionProblemData trainingProblemData, uint seed,
     98      ILossFunction lossFunction, int iterations, int maxSize, double r, double m, double nu,
     99      IGradientBoostedTreesModel model)
    89100      : this(trainingProblemData, seed, lossFunction, iterations, maxSize, r, m, nu) {
    90101      this.actualModel = model;
     
    104115      return new RegressionSolution(this, (IRegressionProblemData)problemData.Clone());
    105116    }
    106 
    107117
    108118    private IGradientBoostedTreesModel RecalculateModel() {
Note: See TracChangeset for help on using the changeset viewer.