- Timestamp:
- 06/19/16 19:56:11 (9 years ago)
- Location:
- trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/GradientBoostedTreesModel.cs
r13157 r13921 58 58 #endregion 59 59 60 public string TargetVariable { 61 get { return models.First().TargetVariable; } 62 } 63 64 public IEnumerable<string> VariablesUsedForPrediction { 65 get { return models.SelectMany(x => x.VariablesUsedForPrediction).Distinct().OrderBy(x => x); } 66 } 67 60 68 private readonly IList<IRegressionModel> models; 61 69 public IEnumerable<IRegressionModel> Models { get { return models; } } … … 108 116 return new RegressionSolution(this, (IRegressionProblemData)problemData.Clone()); 109 117 } 118 110 119 } 111 120 } -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/GradientBoostedTreesModelSurrogate.cs
r13157 r13921 22 22 23 23 using System.Collections.Generic; 24 using System.Linq; 24 25 using HeuristicLab.Common; 25 26 using HeuristicLab.Core; … … 54 55 private int maxSize; 55 56 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 } 56 64 57 65 [StorableConstructor] … … 73 81 74 82 // 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) 76 85 : base("Gradient boosted tree model", string.Empty) { 77 86 this.trainingProblemData = trainingProblemData; … … 86 95 87 96 // 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) 89 100 : this(trainingProblemData, seed, lossFunction, iterations, maxSize, r, m, nu) { 90 101 this.actualModel = model; … … 104 115 return new RegressionSolution(this, (IRegressionProblemData)problemData.Clone()); 105 116 } 106 107 117 108 118 private IGradientBoostedTreesModel RecalculateModel() { -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/RegressionTreeModel.cs
r13895 r13921 35 35 [Item("RegressionTreeModel", "Represents a decision tree for regression.")] 36 36 public sealed class RegressionTreeModel : NamedItem, IRegressionModel { 37 public IEnumerable<string> VariablesUsedForPrediction { 38 get { return Enumerable.Empty<string>(); } 39 } 40 41 public string TargetVariable { 42 get { return string.Empty; } 43 } 37 44 38 45 // trees are represented as a flat array
Note: See TracChangeset
for help on using the changeset viewer.