- Timestamp:
- 10/08/18 16:07:49 (6 years ago)
- Location:
- branches/2883_GBTModelStorage/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2883_GBTModelStorage/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/GradientBoostedTreesAlgorithm.cs
r16158 r16220 54 54 55 55 #region ParameterProperties 56 public IFixedValueParameter<IntValue> IterationsParameter 57 { 56 public IFixedValueParameter<IntValue> IterationsParameter { 58 57 get { return (IFixedValueParameter<IntValue>)Parameters[IterationsParameterName]; } 59 58 } 60 public IFixedValueParameter<IntValue> MaxSizeParameter 61 { 59 public IFixedValueParameter<IntValue> MaxSizeParameter { 62 60 get { return (IFixedValueParameter<IntValue>)Parameters[MaxSizeParameterName]; } 63 61 } 64 public IFixedValueParameter<DoubleValue> NuParameter 65 { 62 public IFixedValueParameter<DoubleValue> NuParameter { 66 63 get { return (IFixedValueParameter<DoubleValue>)Parameters[NuParameterName]; } 67 64 } 68 public IFixedValueParameter<DoubleValue> RParameter 69 { 65 public IFixedValueParameter<DoubleValue> RParameter { 70 66 get { return (IFixedValueParameter<DoubleValue>)Parameters[RParameterName]; } 71 67 } 72 public IFixedValueParameter<DoubleValue> MParameter 73 { 68 public IFixedValueParameter<DoubleValue> MParameter { 74 69 get { return (IFixedValueParameter<DoubleValue>)Parameters[MParameterName]; } 75 70 } 76 public IFixedValueParameter<IntValue> SeedParameter 77 { 71 public IFixedValueParameter<IntValue> SeedParameter { 78 72 get { return (IFixedValueParameter<IntValue>)Parameters[SeedParameterName]; } 79 73 } 80 public FixedValueParameter<BoolValue> SetSeedRandomlyParameter 81 { 74 public FixedValueParameter<BoolValue> SetSeedRandomlyParameter { 82 75 get { return (FixedValueParameter<BoolValue>)Parameters[SetSeedRandomlyParameterName]; } 83 76 } 84 public IConstrainedValueParameter<ILossFunction> LossFunctionParameter 85 { 77 public IConstrainedValueParameter<ILossFunction> LossFunctionParameter { 86 78 get { return (IConstrainedValueParameter<ILossFunction>)Parameters[LossFunctionParameterName]; } 87 79 } 88 public IFixedValueParameter<IntValue> UpdateIntervalParameter 89 { 80 public IFixedValueParameter<IntValue> UpdateIntervalParameter { 90 81 get { return (IFixedValueParameter<IntValue>)Parameters[UpdateIntervalParameterName]; } 91 82 } 92 private IFixedValueParameter<EnumValue<ModelStorage>> CreateSolutionParameter 93 { 83 private IFixedValueParameter<EnumValue<ModelStorage>> CreateSolutionParameter { 94 84 get { return (IFixedValueParameter<EnumValue<ModelStorage>>)Parameters[CreateSolutionParameterName]; } 95 85 } … … 97 87 98 88 #region Properties 99 public int Iterations 100 { 89 public int Iterations { 101 90 get { return IterationsParameter.Value.Value; } 102 91 set { IterationsParameter.Value.Value = value; } 103 92 } 104 public int Seed 105 { 93 public int Seed { 106 94 get { return SeedParameter.Value.Value; } 107 95 set { SeedParameter.Value.Value = value; } 108 96 } 109 public bool SetSeedRandomly 110 { 97 public bool SetSeedRandomly { 111 98 get { return SetSeedRandomlyParameter.Value.Value; } 112 99 set { SetSeedRandomlyParameter.Value.Value = value; } 113 100 } 114 public int MaxSize 115 { 101 public int MaxSize { 116 102 get { return MaxSizeParameter.Value.Value; } 117 103 set { MaxSizeParameter.Value.Value = value; } 118 104 } 119 public double Nu 120 { 105 public double Nu { 121 106 get { return NuParameter.Value.Value; } 122 107 set { NuParameter.Value.Value = value; } 123 108 } 124 public double R 125 { 109 public double R { 126 110 get { return RParameter.Value.Value; } 127 111 set { RParameter.Value.Value = value; } 128 112 } 129 public double M 130 { 113 public double M { 131 114 get { return MParameter.Value.Value; } 132 115 set { MParameter.Value.Value = value; } 133 116 } 134 public ModelStorage CreateSolution 135 { 117 public ModelStorage CreateSolution { 136 118 get { return CreateSolutionParameter.Value.Value; } 137 119 set { CreateSolutionParameter.Value.Value = value; } … … 140 122 141 123 #region ResultsProperties 142 private double ResultsBestQuality 143 { 124 private double ResultsBestQuality { 144 125 get { return ((DoubleValue)Results["Best Quality"].Value).Value; } 145 126 set { ((DoubleValue)Results["Best Quality"].Value).Value = value; } 146 127 } 147 private DataTable ResultsQualities 148 { 128 private DataTable ResultsQualities { 149 129 get { return ((DataTable)Results["Qualities"].Value); } 150 130 } -
branches/2883_GBTModelStorage/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/GradientBoostedTreesModel.cs
r15679 r16220 38 38 39 39 [Storable(Name = "models")] 40 private IList<IRegressionModel> __persistedModels 41 { 42 set 43 { 40 private IList<IRegressionModel> __persistedModels { 41 set { 44 42 this.models.Clear(); 45 43 foreach (var m in value) this.models.Add(m); … … 48 46 } 49 47 [Storable(Name = "weights")] 50 private IList<double> __persistedWeights 51 { 52 set 53 { 48 private IList<double> __persistedWeights { 49 set { 54 50 this.weights.Clear(); 55 51 foreach (var w in value) this.weights.Add(w); … … 59 55 #endregion 60 56 61 public override IEnumerable<string> VariablesUsedForPrediction 62 { 57 public override IEnumerable<string> VariablesUsedForPrediction { 63 58 get { return models.SelectMany(x => x.VariablesUsedForPrediction).Distinct().OrderBy(x => x); } 64 59 } -
branches/2883_GBTModelStorage/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/GradientBoostedTreesModelSurrogate.cs
r15679 r16220 39 39 // the actual model is only recalculated when necessary 40 40 private readonly Lazy<IGradientBoostedTreesModel> actualModel; 41 private IGradientBoostedTreesModel ActualModel 42 { 41 private IGradientBoostedTreesModel ActualModel { 43 42 get { return actualModel.Value; } 44 43 } … … 62 61 63 62 64 public override IEnumerable<string> VariablesUsedForPrediction 65 { 66 get 67 { 63 public override IEnumerable<string> VariablesUsedForPrediction { 64 get { 68 65 return ActualModel.Models.SelectMany(x => x.VariablesUsedForPrediction).Distinct().OrderBy(x => x); 69 66 } … … 137 134 } 138 135 139 public IEnumerable<IRegressionModel> Models 140 { 141 get 142 { 136 public IEnumerable<IRegressionModel> Models { 137 get { 143 138 return ActualModel.Models; 144 139 } 145 140 } 146 141 147 public IEnumerable<double> Weights 148 { 149 get 150 { 142 public IEnumerable<double> Weights { 143 get { 151 144 return ActualModel.Weights; 152 145 }
Note: See TracChangeset
for help on using the changeset viewer.