Changeset 15675
- Timestamp:
- 01/30/18 15:06:28 (7 years ago)
- Location:
- branches/2883_GBTModelStorage/HeuristicLab.Algorithms.DataAnalysis/3.4
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2883_GBTModelStorage/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/GradientBoostedTreesAlgorithm.cs
r15583 r15675 23 23 using System.Linq; 24 24 using System.Threading; 25 using HeuristicLab.Algorithms.DataAnalysis.GradientBoostedTrees; 25 26 using HeuristicLab.Analysis; 26 27 using HeuristicLab.Common; … … 52 53 53 54 #region ParameterProperties 54 public IFixedValueParameter<IntValue> IterationsParameter { 55 public IFixedValueParameter<IntValue> IterationsParameter 56 { 55 57 get { return (IFixedValueParameter<IntValue>)Parameters[IterationsParameterName]; } 56 58 } 57 public IFixedValueParameter<IntValue> MaxSizeParameter { 59 public IFixedValueParameter<IntValue> MaxSizeParameter 60 { 58 61 get { return (IFixedValueParameter<IntValue>)Parameters[MaxSizeParameterName]; } 59 62 } 60 public IFixedValueParameter<DoubleValue> NuParameter { 63 public IFixedValueParameter<DoubleValue> NuParameter 64 { 61 65 get { return (IFixedValueParameter<DoubleValue>)Parameters[NuParameterName]; } 62 66 } 63 public IFixedValueParameter<DoubleValue> RParameter { 67 public IFixedValueParameter<DoubleValue> RParameter 68 { 64 69 get { return (IFixedValueParameter<DoubleValue>)Parameters[RParameterName]; } 65 70 } 66 public IFixedValueParameter<DoubleValue> MParameter { 71 public IFixedValueParameter<DoubleValue> MParameter 72 { 67 73 get { return (IFixedValueParameter<DoubleValue>)Parameters[MParameterName]; } 68 74 } 69 public IFixedValueParameter<IntValue> SeedParameter { 75 public IFixedValueParameter<IntValue> SeedParameter 76 { 70 77 get { return (IFixedValueParameter<IntValue>)Parameters[SeedParameterName]; } 71 78 } 72 public FixedValueParameter<BoolValue> SetSeedRandomlyParameter { 79 public FixedValueParameter<BoolValue> SetSeedRandomlyParameter 80 { 73 81 get { return (FixedValueParameter<BoolValue>)Parameters[SetSeedRandomlyParameterName]; } 74 82 } 75 public IConstrainedValueParameter<ILossFunction> LossFunctionParameter { 83 public IConstrainedValueParameter<ILossFunction> LossFunctionParameter 84 { 76 85 get { return (IConstrainedValueParameter<ILossFunction>)Parameters[LossFunctionParameterName]; } 77 86 } 78 public IFixedValueParameter<IntValue> UpdateIntervalParameter { 87 public IFixedValueParameter<IntValue> UpdateIntervalParameter 88 { 79 89 get { return (IFixedValueParameter<IntValue>)Parameters[UpdateIntervalParameterName]; } 80 90 } 81 public IFixedValueParameter<BoolValue> CreateSolutionParameter { 82 get { return (IFixedValueParameter<BoolValue>)Parameters[CreateSolutionParameterName]; } 91 private IFixedValueParameter<EnumValue<ModelStorage>> CreateSolutionParameter 92 { 93 get { return (IFixedValueParameter<EnumValue<ModelStorage>>)Parameters[CreateSolutionParameterName]; } 83 94 } 84 95 #endregion 85 96 86 97 #region Properties 87 public int Iterations { 98 public int Iterations 99 { 88 100 get { return IterationsParameter.Value.Value; } 89 101 set { IterationsParameter.Value.Value = value; } 90 102 } 91 public int Seed { 103 public int Seed 104 { 92 105 get { return SeedParameter.Value.Value; } 93 106 set { SeedParameter.Value.Value = value; } 94 107 } 95 public bool SetSeedRandomly { 108 public bool SetSeedRandomly 109 { 96 110 get { return SetSeedRandomlyParameter.Value.Value; } 97 111 set { SetSeedRandomlyParameter.Value.Value = value; } 98 112 } 99 public int MaxSize { 113 public int MaxSize 114 { 100 115 get { return MaxSizeParameter.Value.Value; } 101 116 set { MaxSizeParameter.Value.Value = value; } 102 117 } 103 public double Nu { 118 public double Nu 119 { 104 120 get { return NuParameter.Value.Value; } 105 121 set { NuParameter.Value.Value = value; } 106 122 } 107 public double R { 123 public double R 124 { 108 125 get { return RParameter.Value.Value; } 109 126 set { RParameter.Value.Value = value; } 110 127 } 111 public double M { 128 public double M 129 { 112 130 get { return MParameter.Value.Value; } 113 131 set { MParameter.Value.Value = value; } 114 132 } 115 public bool CreateSolution { 133 public ModelStorage CreateSolution 134 { 116 135 get { return CreateSolutionParameter.Value.Value; } 117 136 set { CreateSolutionParameter.Value.Value = value; } … … 120 139 121 140 #region ResultsProperties 122 private double ResultsBestQuality { 141 private double ResultsBestQuality 142 { 123 143 get { return ((DoubleValue)Results["Best Quality"].Value).Value; } 124 144 set { ((DoubleValue)Results["Best Quality"].Value).Value = value; } 125 145 } 126 private DataTable ResultsQualities { 146 private DataTable ResultsQualities 147 { 127 148 get { return ((DataTable)Results["Qualities"].Value); } 128 149 } … … 152 173 Parameters.Add(new FixedValueParameter<IntValue>(UpdateIntervalParameterName, "", new IntValue(100))); 153 174 Parameters[UpdateIntervalParameterName].Hidden = true; 154 Parameters.Add(new FixedValueParameter< BoolValue>(CreateSolutionParameterName, "Flag that indicates if a solution should be produced at the end of the run", new BoolValue(true)));175 Parameters.Add(new FixedValueParameter<EnumValue<ModelStorage>>(CreateSolutionParameterName, "Flag that indicates what kind of solution should be produced at the end of the run", new EnumValue<ModelStorage>(ModelStorage.Parameter))); 155 176 Parameters[CreateSolutionParameterName].Hidden = true; 156 177 … … 164 185 // BackwardsCompatibility3.4 165 186 #region Backwards compatible code, remove with 3.5 187 188 #region LossFunction 166 189 // parameter type has been changed 167 190 var lossFunctionParam = Parameters[LossFunctionParameterName] as ConstrainedValueParameter<StringValue>; … … 182 205 } 183 206 #endregion 207 208 #region CreateSolution 209 // parameter type has been changed 210 var createSolutionParam = Parameters[CreateSolutionParameterName] as FixedValueParameter<BoolValue>; 211 if (createSolutionParam != null) { 212 Parameters.Remove(CreateSolutionParameterName); 213 214 ModelStorage value = createSolutionParam.Value.Value ? ModelStorage.Parameter : ModelStorage.Quality; 215 Parameters.Add(new FixedValueParameter<EnumValue<ModelStorage>>(CreateSolutionParameterName, "Flag that indicates what kind of solution should be produced at the end of the run", new EnumValue<ModelStorage>(value))); 216 Parameters[CreateSolutionParameterName].Hidden = true; 217 } 218 #endregion 219 #endregion 184 220 } 185 221 … … 248 284 249 285 // produce solution 250 if (CreateSolution ) {286 if (CreateSolution == ModelStorage.Parameter) { 251 287 var model = state.GetModel(); 252 288 -
branches/2883_GBTModelStorage/HeuristicLab.Algorithms.DataAnalysis/3.4/HeuristicLab.Algorithms.DataAnalysis-3.4.csproj
r15670 r15675 308 308 <Compile Include="GradientBoostedTrees\LossFunctions\SquaredErrorLoss.cs" /> 309 309 <Compile Include="GradientBoostedTrees\GradientBoostedTreesSolution.cs" /> 310 <Compile Include="GradientBoostedTrees\ModelStorage.cs" /> 310 311 <Compile Include="GradientBoostedTrees\RegressionTreeBuilder.cs" /> 311 312 <Compile Include="GradientBoostedTrees\RegressionTreeModel.cs" /> -
branches/2883_GBTModelStorage/HeuristicLab.Algorithms.DataAnalysis/3.4/Plugin.cs
r15670 r15675 26 26 /// Plugin class for HeuristicLab.Algorithms.DataAnalysis plugin. 27 27 /// </summary> 28 [Plugin("HeuristicLab.Algorithms.DataAnalysis", "Provides wrappers for data analysis algorithms implemented in external libraries (linear regression, linear discriminant analysis, k-means clustering, support vector classification and regression)", "3.4.11.15 589")]28 [Plugin("HeuristicLab.Algorithms.DataAnalysis", "Provides wrappers for data analysis algorithms implemented in external libraries (linear regression, linear discriminant analysis, k-means clustering, support vector classification and regression)", "3.4.11.15670")] 29 29 [PluginFile("HeuristicLab.Algorithms.DataAnalysis-3.4.dll", PluginFileType.Assembly)] 30 30 [PluginDependency("HeuristicLab.ALGLIB", "3.7.0")]
Note: See TracChangeset
for help on using the changeset viewer.