Changeset 12547 for branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression
- Timestamp:
- 06/30/15 12:32:08 (9 years ago)
- Location:
- branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression
- Property svn:mergeinfo changed
-
branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4 merged: 12358,12422,12461,12504,12509
- Property svn:mergeinfo changed
-
branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective/SymbolicRegressionMultiObjectiveProblem.cs
r12130 r12547 29 29 30 30 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Regression { 31 [Item("Symbolic Regression Problem (multi 31 [Item("Symbolic Regression Problem (multi-objective)", "Represents a multi objective symbolic regression problem.")] 32 32 [StorableClass] 33 [Creatable( "Problems")]33 [Creatable(CreatableAttribute.Categories.GeneticProgrammingProblems, Priority = 110)] 34 34 public class SymbolicRegressionMultiObjectiveProblem : SymbolicDataAnalysisMultiObjectiveProblem<IRegressionProblemData, ISymbolicRegressionMultiObjectiveEvaluator, ISymbolicDataAnalysisSolutionCreator>, IRegressionProblem { 35 35 private const double PunishmentFactor = 10; -
branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionConstantOptimizationEvaluator.cs
r12130 r12547 202 202 int info; 203 203 204 Dataset ds = problemData.Dataset;204 IDataset ds = problemData.Dataset; 205 205 double[,] x = new double[rows.Count(), variableNames.Count]; 206 206 int row = 0; -
branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/SymbolicRegressionSingleObjectiveProblem.cs
r12130 r12547 28 28 29 29 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Regression { 30 [Item("Symbolic Regression Problem (single 30 [Item("Symbolic Regression Problem (single-objective)", "Represents a single objective symbolic regression problem.")] 31 31 [StorableClass] 32 [Creatable( "Problems")]32 [Creatable(CreatableAttribute.Categories.GeneticProgrammingProblems, Priority = 100)] 33 33 public class SymbolicRegressionSingleObjectiveProblem : SymbolicDataAnalysisSingleObjectiveProblem<IRegressionProblemData, ISymbolicRegressionSingleObjectiveEvaluator, ISymbolicDataAnalysisSolutionCreator>, IRegressionProblem { 34 34 private const double PunishmentFactor = 10; -
branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionModel.cs
r12130 r12547 47 47 } 48 48 49 public IEnumerable<double> GetEstimatedValues( Dataset dataset, IEnumerable<int> rows) {49 public IEnumerable<double> GetEstimatedValues(IDataset dataset, IEnumerable<int> rows) { 50 50 return Interpreter.GetSymbolicExpressionTreeValues(SymbolicExpressionTree, dataset, rows) 51 51 .LimitToRange(LowerEstimationLimit, UpperEstimationLimit); -
branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionPhenotypicDiversityAnalyzer.cs
r12130 r12547 35 35 [StorableClass] 36 36 public class SymbolicRegressionPhenotypicDiversityAnalyzer : PopulationSimilarityAnalyzer, 37 ISymbolicDataAnalysisBoundedOperator, ISymbolicDataAnalysisInterpreterOperator, ISymbolicExpressionTree Operator {37 ISymbolicDataAnalysisBoundedOperator, ISymbolicDataAnalysisInterpreterOperator, ISymbolicExpressionTreeAnalyzer { 38 38 #region parameter names 39 39 private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree"; -
branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionPruningAnalyzer.cs
r12214 r12547 31 31 [StorableClass] 32 32 public sealed class SymbolicRegressionPruningAnalyzer : SymbolicDataAnalysisSingleObjectivePruningAnalyzer { 33 private const string ImpactValuesCalculatorParameterName = "ImpactValuesCalculator";34 33 private const string PruningOperatorParameterName = "PruningOperator"; 35 p rivate SymbolicRegressionPruningAnalyzer(SymbolicRegressionPruningAnalyzer original, Cloner cloner)36 : base(original, cloner) {34 public IValueParameter<SymbolicRegressionPruningOperator> PruningOperatorParameter { 35 get { return (IValueParameter<SymbolicRegressionPruningOperator>)Parameters[PruningOperatorParameterName]; } 37 36 } 38 public override IDeepCloneable Clone(Cloner cloner) { 39 return new SymbolicRegressionPruningAnalyzer(this, cloner); 37 38 protected override SymbolicDataAnalysisExpressionPruningOperator PruningOperator { 39 get { return PruningOperatorParameter.Value; } 40 40 } 41 42 private SymbolicRegressionPruningAnalyzer(SymbolicRegressionPruningAnalyzer original, Cloner cloner) : base(original, cloner) { } 43 public override IDeepCloneable Clone(Cloner cloner) { return new SymbolicRegressionPruningAnalyzer(this, cloner); } 41 44 42 45 [StorableConstructor] … … 44 47 45 48 public SymbolicRegressionPruningAnalyzer() { 46 Parameters.Add(new ValueParameter<SymbolicDataAnalysisSolutionImpactValuesCalculator>(ImpactValuesCalculatorParameterName, "The impact values calculator", new SymbolicRegressionSolutionImpactValuesCalculator())); 47 Parameters.Add(new ValueParameter<SymbolicDataAnalysisExpressionPruningOperator>(PruningOperatorParameterName, "The operator used to prune trees", new SymbolicRegressionPruningOperator(new SymbolicRegressionSolutionImpactValuesCalculator()))); 49 Parameters.Add(new ValueParameter<SymbolicRegressionPruningOperator>(PruningOperatorParameterName, "The operator used to prune trees", new SymbolicRegressionPruningOperator(new SymbolicRegressionSolutionImpactValuesCalculator()))); 48 50 } 49 51 } -
branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionPruningOperator.cs
r12214 r12547 53 53 protected override double Evaluate(IDataAnalysisModel model) { 54 54 var regressionModel = (IRegressionModel)model; 55 var regressionProblemData = (IRegressionProblemData)ProblemData ;56 var rows = Enumerable.Range(FitnessCalculationPartition .Start, FitnessCalculationPartition.Size);55 var regressionProblemData = (IRegressionProblemData)ProblemDataParameter.ActualValue; 56 var rows = Enumerable.Range(FitnessCalculationPartitionParameter.ActualValue.Start, FitnessCalculationPartitionParameter.ActualValue.Size); 57 57 return Evaluate(regressionModel, regressionProblemData, rows); 58 58 } … … 71 71 var clonedTree = (ISymbolicExpressionTree)tree.Clone(); 72 72 var model = new SymbolicRegressionModel(clonedTree, interpreter, estimationLimits.Lower, estimationLimits.Upper); 73 var nodes = clonedTree. IterateNodesPrefix().ToList();73 var nodes = clonedTree.Root.GetSubtree(0).GetSubtree(0).IterateNodesPrefix().ToList(); // skip the nodes corresponding to the ProgramRootSymbol and the StartSymbol 74 74 double quality = Evaluate(model, problemData, rows); 75 75 … … 81 81 impactValuesCalculator.CalculateImpactAndReplacementValues(model, node, problemData, rows, out impactValue, out replacementValue, quality); 82 82 83 if (pruneOnlyZeroImpactNodes) { 84 if (!impactValue.IsAlmost(0.0)) continue; 85 } else if (nodeImpactThreshold < impactValue) { 86 continue; 87 } 83 if (pruneOnlyZeroImpactNodes && !impactValue.IsAlmost(0.0)) continue; 84 if (!pruneOnlyZeroImpactNodes && impactValue > nodeImpactThreshold) continue; 88 85 89 86 var constantNode = (ConstantTreeNode)node.Grammar.GetSymbol("Constant").CreateTreeNode();
Note: See TracChangeset
for help on using the changeset viewer.