Changeset 16847 for branches/2847_M5Regression/HeuristicLab.Algorithms.DataAnalysis/3.4/M5Regression/MetaModels
- Timestamp:
- 04/19/19 13:06:11 (6 years ago)
- Location:
- branches/2847_M5Regression/HeuristicLab.Algorithms.DataAnalysis/3.4/M5Regression/MetaModels
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2847_M5Regression/HeuristicLab.Algorithms.DataAnalysis/3.4/M5Regression/MetaModels/RegressionNodeModel.cs
r16069 r16847 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using HeuristicLab.Common; 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 25 using HeuristicLab.Common; 27 26 using HeuristicLab.Problems.DataAnalysis; 27 using HEAL.Attic; 28 28 29 29 namespace HeuristicLab.Algorithms.DataAnalysis { 30 [Storable Class]30 [StorableType("C20C7DF1-CE33-4CCD-88D3-E145CFE239AC")] 31 31 public class RegressionNodeModel : RegressionModel { 32 32 #region Properties … … 65 65 #region HLConstructors 66 66 [StorableConstructor] 67 protected RegressionNodeModel( bool deserializing) : base(deserializing) { }67 protected RegressionNodeModel(StorableConstructorFlag _) : base(_) { } 68 68 protected RegressionNodeModel(RegressionNodeModel original, Cloner cloner) : base(original, cloner) { 69 69 IsLeaf = original.IsLeaf; … … 147 147 #endregion 148 148 149 [Storable Class]149 [StorableType("1FF9E216-6AF1-4282-A7EF-3FA0C1DB29C8")] 150 150 private sealed class ConfidenceRegressionNodeModel : RegressionNodeModel, IConfidenceRegressionModel { 151 151 #region HLConstructors 152 152 [StorableConstructor] 153 private ConfidenceRegressionNodeModel( bool deserializing) : base(deserializing) { }153 private ConfidenceRegressionNodeModel(StorableConstructorFlag _) : base(_) { } 154 154 private ConfidenceRegressionNodeModel(ConfidenceRegressionNodeModel original, Cloner cloner) : base(original, cloner) { } 155 155 public ConfidenceRegressionNodeModel(string targetAttr) : base(targetAttr) { } -
branches/2847_M5Regression/HeuristicLab.Algorithms.DataAnalysis/3.4/M5Regression/MetaModels/RegressionNodeTreeModel.cs
r16069 r16847 27 27 using HeuristicLab.Core; 28 28 using HeuristicLab.Optimization; 29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;30 29 using HeuristicLab.Problems.DataAnalysis; 30 using HEAL.Attic; 31 31 32 32 namespace HeuristicLab.Algorithms.DataAnalysis { 33 [Storable Class]33 [StorableType("FAF1F955-82F3-4824-9759-9D2846E831AE")] 34 34 public class RegressionNodeTreeModel : RegressionModel, IM5Model { 35 35 public const string NumCurrentLeafsResultName = "Number of current leafs"; … … 42 42 #region HLConstructors & Cloning 43 43 [StorableConstructor] 44 protected RegressionNodeTreeModel( bool deserializing) : base(deserializing) { }44 protected RegressionNodeTreeModel(StorableConstructorFlag _) : base(_) { } 45 45 protected RegressionNodeTreeModel(RegressionNodeTreeModel original, Cloner cloner) : base(original, cloner) { 46 46 Root = cloner.Clone(original.Root); … … 97 97 #endregion 98 98 99 public void BuildModel less(IReadOnlyList<int> trainingRows, IReadOnlyList<int> pruningRows, IScope statescope, ResultCollection results, CancellationToken cancellationToken) {99 public void BuildModel(IReadOnlyList<int> trainingRows, IReadOnlyList<int> pruningRows, IScope statescope, ResultCollection results, CancellationToken cancellationToken) { 100 100 var regressionTreeParams = (RegressionTreeParameters)statescope.Variables[M5Regression.RegressionTreeParameterVariableName].Value; 101 101 //start with one node … … 109 109 } 110 110 111 [Storable Class]111 [StorableType("E84ACC40-5694-4E40-A947-190673643206")] 112 112 private sealed class ConfidenceRegressionNodeTreeModel : RegressionNodeTreeModel, IConfidenceRegressionModel { 113 113 #region HLConstructors & Cloning 114 114 [StorableConstructor] 115 private ConfidenceRegressionNodeTreeModel( bool deserializing) : base(deserializing) { }115 private ConfidenceRegressionNodeTreeModel(StorableConstructorFlag _) : base(_) { } 116 116 private ConfidenceRegressionNodeTreeModel(ConfidenceRegressionNodeTreeModel original, Cloner cloner) : base(original, cloner) { } 117 117 public ConfidenceRegressionNodeTreeModel(string targetVariable) : base(targetVariable) { } -
branches/2847_M5Regression/HeuristicLab.Algorithms.DataAnalysis/3.4/M5Regression/MetaModels/RegressionRuleModel.cs
r15830 r16847 28 28 using HeuristicLab.Core; 29 29 using HeuristicLab.Optimization; 30 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;31 30 using HeuristicLab.Problems.DataAnalysis; 31 using HEAL.Attic; 32 32 33 33 namespace HeuristicLab.Algorithms.DataAnalysis { 34 [Storable Class]34 [StorableType("425AF262-A756-4E9A-B76F-4D2480BEA4FD")] 35 35 public class RegressionRuleModel : RegressionModel, IM5Model { 36 36 #region Properties … … 49 49 #region HLConstructors 50 50 [StorableConstructor] 51 protected RegressionRuleModel( bool deserializing) : base(deserializing) { }51 protected RegressionRuleModel(StorableConstructorFlag _) : base(_) { } 52 52 protected RegressionRuleModel(RegressionRuleModel original, Cloner cloner) : base(original, cloner) { 53 53 if (original.SplitAttributes != null) SplitAttributes = original.SplitAttributes.ToArray(); … … 88 88 //build tree and select node with maximum coverage 89 89 var tree = RegressionNodeTreeModel.CreateTreeModel(regressionTreeParams.TargetVariable, regressionTreeParams); 90 tree.BuildModel less(trainingRows, pruningRows, statescope, results, cancellationToken);90 tree.BuildModel(trainingRows, pruningRows, statescope, results, cancellationToken); 91 91 var nodeModel = tree.Root.EnumerateNodes().Where(x => x.IsLeaf).MaxItems(x => x.NumSamples).First(); 92 92 … … 95 95 var reops = new List<Comparison>(); 96 96 97 //extract Splits97 //extract splits 98 98 for (var temp = nodeModel; temp.Parent != null; temp = temp.Parent) { 99 99 satts.Add(temp.Parent.SplitAttribute); … … 137 137 } 138 138 139 [Storable Class]139 [StorableType("7302AA30-9F58-42F3-BF6A-ECF1536508AB")] 140 140 private sealed class ConfidenceRegressionRuleModel : RegressionRuleModel, IConfidenceRegressionModel { 141 141 #region HLConstructors 142 142 [StorableConstructor] 143 private ConfidenceRegressionRuleModel( bool deserializing) : base(deserializing) { }143 private ConfidenceRegressionRuleModel(StorableConstructorFlag _) : base(_) { } 144 144 private ConfidenceRegressionRuleModel(ConfidenceRegressionRuleModel original, Cloner cloner) : base(original, cloner) { } 145 145 public ConfidenceRegressionRuleModel(string targetAttr) : base(targetAttr) { } … … 159 159 } 160 160 161 [StorableType("152DECE4-2692-4D53-B290-974806ADCD72")] 161 162 internal enum Comparison { 162 163 LessEqual, -
branches/2847_M5Regression/HeuristicLab.Algorithms.DataAnalysis/3.4/M5Regression/MetaModels/RegressionRuleSetModel.cs
r15830 r16847 28 28 using HeuristicLab.Data; 29 29 using HeuristicLab.Optimization; 30 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;31 30 using HeuristicLab.Problems.DataAnalysis; 31 using HEAL.Attic; 32 32 33 33 namespace HeuristicLab.Algorithms.DataAnalysis { 34 [Storable Class]34 [StorableType("7B4D9AE9-0456-4029-80A6-CCB5E33CE356")] 35 35 public class RegressionRuleSetModel : RegressionModel, IM5Model { 36 36 private const string NumRulesResultName = "Number of rules"; … … 45 45 #region HLConstructors & Cloning 46 46 [StorableConstructor] 47 protected RegressionRuleSetModel( bool deserializing) : base(deserializing) { }47 protected RegressionRuleSetModel(StorableConstructorFlag _) : base(_) { } 48 48 protected RegressionRuleSetModel(RegressionRuleSetModel original, Cloner cloner) : base(original, cloner) { 49 49 if (original.Rules != null) Rules = original.Rules.Select(cloner.Clone).ToList(); … … 123 123 #endregion 124 124 125 [Storable Class]125 [StorableType("E114F3C9-3C1F-443D-8270-0E10CE12F2A0")] 126 126 public class RuleSetState : Item { 127 127 [Storable] … … 140 140 #region HLConstructors & Cloning 141 141 [StorableConstructor] 142 protected RuleSetState( bool deserializing) : base(deserializing) { }142 protected RuleSetState(StorableConstructorFlag _) : base(_) { } 143 143 protected RuleSetState(RuleSetState original, Cloner cloner) : base(original, cloner) { 144 144 Rules = original.Rules.Select(cloner.Clone).ToList(); … … 155 155 } 156 156 157 [Storable Class]157 [StorableType("52E7992B-94CC-4960-AA82-1A399BE735C6")] 158 158 private sealed class ConfidenceRegressionRuleSetModel : RegressionRuleSetModel, IConfidenceRegressionModel { 159 159 #region HLConstructors & Cloning 160 160 [StorableConstructor] 161 private ConfidenceRegressionRuleSetModel( bool deserializing) : base(deserializing) { }161 private ConfidenceRegressionRuleSetModel(StorableConstructorFlag _) : base(_) { } 162 162 private ConfidenceRegressionRuleSetModel(ConfidenceRegressionRuleSetModel original, Cloner cloner) : base(original, cloner) { } 163 163 public ConfidenceRegressionRuleSetModel(string targetVariable) : base(targetVariable) { }
Note: See TracChangeset
for help on using the changeset viewer.