Changeset 12694 for branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification
- Timestamp:
- 07/09/15 13:07:30 (9 years ago)
- Location:
- branches/HeuristicLab.Problems.Orienteering
- Files:
-
- 42 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Problems.Orienteering
- Property svn:mergeinfo changed
-
Property
svn:global-ignores
set to
*.nuget
packages
-
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification
- Property svn:mergeinfo changed
-
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification-3.4.csproj
r10469 r12694 11 11 <RootNamespace>HeuristicLab.Problems.DataAnalysis.Symbolic.Classification</RootNamespace> 12 12 <AssemblyName>HeuristicLab.Problems.DataAnalysis.Symbolic.Classification-3.4</AssemblyName> 13 <TargetFrameworkVersion>v4. 0</TargetFrameworkVersion>13 <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> 14 14 <TargetFrameworkProfile> 15 15 </TargetFrameworkProfile> … … 46 46 <WarningLevel>4</WarningLevel> 47 47 <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> 48 <Prefer32Bit>false</Prefer32Bit> 48 49 </PropertyGroup> 49 50 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> … … 55 56 <WarningLevel>4</WarningLevel> 56 57 <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> 58 <Prefer32Bit>false</Prefer32Bit> 57 59 </PropertyGroup> 58 60 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' "> … … 64 66 <ErrorReport>prompt</ErrorReport> 65 67 <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> 68 <Prefer32Bit>false</Prefer32Bit> 66 69 </PropertyGroup> 67 70 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' "> … … 73 76 <ErrorReport>prompt</ErrorReport> 74 77 <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> 78 <Prefer32Bit>false</Prefer32Bit> 75 79 </PropertyGroup> 76 80 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> … … 82 86 <ErrorReport>prompt</ErrorReport> 83 87 <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> 88 <Prefer32Bit>false</Prefer32Bit> 84 89 </PropertyGroup> 85 90 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> … … 91 96 <ErrorReport>prompt</ErrorReport> 92 97 <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> 98 <Prefer32Bit>false</Prefer32Bit> 93 99 </PropertyGroup> 94 100 <ItemGroup> … … 120 126 <Compile Include="ModelCreators\NormalDistributedThresholdsModelCreator.cs" /> 121 127 <Compile Include="MultiObjective\SymbolicClassificationMultiObjectiveValidationBestSolutionAnalyzer.cs" /> 128 <Compile Include="SymbolicClassificationPhenotypicDiversityAnalyzer.cs" /> 122 129 <Compile Include="SymbolicClassificationPruningAnalyzer.cs" /> 123 130 <Compile Include="SymbolicClassificationSolutionImpactValuesCalculator.cs" /> … … 216 223 <Private>False</Private> 217 224 </ProjectReference> 225 <ProjectReference Include="..\..\HeuristicLab.Optimization.Operators\3.3\HeuristicLab.Optimization.Operators-3.3.csproj"> 226 <Project>{25087811-F74C-4128-BC86-8324271DA13E}</Project> 227 <Name>HeuristicLab.Optimization.Operators-3.3</Name> 228 <Private>False</Private> 229 </ProjectReference> 218 230 <ProjectReference Include="..\..\HeuristicLab.Optimization\3.3\HeuristicLab.Optimization-3.3.csproj"> 219 231 <Project>{14AB8D24-25BC-400C-A846-4627AA945192}</Project> -
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/Interfaces/ISymbolicClassificationEvaluator.cs
r11185 r12694 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/Interfaces/ISymbolicClassificationModel.cs
r11185 r12694 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/Interfaces/ISymbolicClassificationModelCreator.cs
r11185 r12694 2 2 3 3 /* HeuristicLab 4 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)4 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 5 5 * 6 6 * This file is part of HeuristicLab. -
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/Interfaces/ISymbolicClassificationModelCreatorOperator.cs
r11185 r12694 2 2 3 3 /* HeuristicLab 4 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)4 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 5 5 * 6 6 * This file is part of HeuristicLab. -
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/Interfaces/ISymbolicClassificationMultiObjectiveEvaluator.cs
r11185 r12694 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/Interfaces/ISymbolicClassificationSingleObjectiveEvaluator.cs
r11185 r12694 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/Interfaces/ISymbolicClassificationSolution.cs
r11185 r12694 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/Interfaces/ISymbolicDiscriminantFunctionClassificationModel.cs
r11185 r12694 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/Interfaces/ISymbolicDiscriminantFunctionClassificationModelCreator.cs
r11185 r12694 2 2 3 3 /* HeuristicLab 4 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)4 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 5 5 * 6 6 * This file is part of HeuristicLab. -
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/ModelCreators/AccuracyMaximizingThresholdsModelCreator.cs
r11185 r12694 2 2 3 3 /* HeuristicLab 4 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)4 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 5 5 * 6 6 * This file is part of HeuristicLab. -
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/ModelCreators/NearestNeighborModelCreator.cs
r11185 r12694 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/ModelCreators/NormalDistributedThresholdsModelCreator.cs
r11185 r12694 2 2 3 3 /* HeuristicLab 4 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)4 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 5 5 * 6 6 * This file is part of HeuristicLab. -
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/MultiObjective/SymbolicClassificationMultiObjectiveEvaluator.cs
r11185 r12694 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/MultiObjective/SymbolicClassificationMultiObjectiveMeanSquaredErrorTreeSizeEvaluator.cs
r11185 r12694 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/MultiObjective/SymbolicClassificationMultiObjectivePearsonRSquaredTreeSizeEvaluator.cs
r11185 r12694 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 57 57 OnlineCalculatorError errorState; 58 58 59 double r 2;59 double r; 60 60 if (applyLinearScaling) { 61 var r 2Calculator = new OnlinePearsonsRSquaredCalculator();62 CalculateWithScaling(targetValues, estimatedValues, lowerEstimationLimit, upperEstimationLimit, r 2Calculator, problemData.Dataset.Rows);63 errorState = r 2Calculator.ErrorState;64 r 2 = r2Calculator.RSquared;61 var rCalculator = new OnlinePearsonsRCalculator(); 62 CalculateWithScaling(targetValues, estimatedValues, lowerEstimationLimit, upperEstimationLimit, rCalculator, problemData.Dataset.Rows); 63 errorState = rCalculator.ErrorState; 64 r = rCalculator.R; 65 65 } else { 66 66 IEnumerable<double> boundedEstimatedValues = estimatedValues.LimitToRange(lowerEstimationLimit, upperEstimationLimit); 67 r 2 = OnlinePearsonsRSquaredCalculator.Calculate(targetValues, boundedEstimatedValues, out errorState);67 r = OnlinePearsonsRCalculator.Calculate(targetValues, boundedEstimatedValues, out errorState); 68 68 } 69 69 70 if (errorState != OnlineCalculatorError.None) r 2= double.NaN;71 return new double[2] { r 2, solution.Length };70 if (errorState != OnlineCalculatorError.None) r = double.NaN; 71 return new double[2] { r*r, solution.Length }; 72 72 73 73 } -
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/MultiObjective/SymbolicClassificationMultiObjectiveProblem.cs
r11185 r12694 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 23 23 using HeuristicLab.Core; 24 24 using HeuristicLab.Data; 25 using HeuristicLab.Optimization; 25 26 using HeuristicLab.Parameters; 26 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 28 28 29 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Classification { 29 [Item("Symbolic Classification Problem (multi 30 [Item("Symbolic Classification Problem (multi-objective)", "Represents a multi objective symbolic classfication problem.")] 30 31 [StorableClass] 31 [Creatable( "Problems")]32 [Creatable(CreatableAttribute.Categories.GeneticProgrammingProblems, Priority = 130)] 32 33 public class SymbolicClassificationMultiObjectiveProblem : SymbolicDataAnalysisMultiObjectiveProblem<IClassificationProblemData, ISymbolicClassificationMultiObjectiveEvaluator, ISymbolicDataAnalysisSolutionCreator>, IClassificationProblem { 33 34 private const double PunishmentFactor = 10; … … 105 106 Operators.Add(new SymbolicClassificationMultiObjectiveTrainingBestSolutionAnalyzer()); 106 107 Operators.Add(new SymbolicClassificationMultiObjectiveValidationBestSolutionAnalyzer()); 108 Operators.Add(new SymbolicExpressionTreePhenotypicSimilarityCalculator()); 109 Operators.Add(new SymbolicClassificationPhenotypicDiversityAnalyzer(Operators.OfType<SymbolicExpressionTreePhenotypicSimilarityCalculator>())); 107 110 ParameterizeOperators(); 108 111 } … … 135 138 op.ModelCreatorParameter.ActualName = ModelCreatorParameter.Name; 136 139 } 140 141 foreach (var op in Operators.OfType<ISolutionSimilarityCalculator>()) { 142 op.SolutionVariableName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName; 143 op.QualityVariableName = Evaluator.QualitiesParameter.ActualName; 144 145 if (op is SymbolicExpressionTreePhenotypicSimilarityCalculator) { 146 var phenotypicSimilarityCalculator = (SymbolicExpressionTreePhenotypicSimilarityCalculator)op; 147 phenotypicSimilarityCalculator.ProblemData = ProblemData; 148 phenotypicSimilarityCalculator.Interpreter = SymbolicExpressionTreeInterpreter; 149 } 150 } 137 151 } 138 152 } -
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/MultiObjective/SymbolicClassificationMultiObjectiveTrainingBestSolutionAnalyzer.cs
r11185 r12694 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/MultiObjective/SymbolicClassificationMultiObjectiveValidationBestSolutionAnalyzer.cs
r11185 r12694 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/Plugin.cs.frame
r11185 r12694 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 26 26 27 27 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Classification { 28 [Plugin("HeuristicLab.Problems.DataAnalysis.Symbolic.Classification","Provides classes to perform symbolic classification (single- or multiobjective).", "3.4. 6.$WCREV$")]28 [Plugin("HeuristicLab.Problems.DataAnalysis.Symbolic.Classification","Provides classes to perform symbolic classification (single- or multiobjective).", "3.4.7.$WCREV$")] 29 29 [PluginFile("HeuristicLab.Problems.DataAnalysis.Symbolic.Classification-3.4.dll", PluginFileType.Assembly)] 30 30 [PluginDependency("HeuristicLab.ALGLIB", "3.7.0")] -
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/Properties/AssemblyInfo.cs.frame
r11185 r12694 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 31 31 [assembly: AssemblyCompany("")] 32 32 [assembly: AssemblyProduct("HeuristicLab")] 33 [assembly: AssemblyCopyright("(c) 2002-201 4HEAL")]33 [assembly: AssemblyCopyright("(c) 2002-2015 HEAL")] 34 34 [assembly: AssemblyTrademark("")] 35 35 [assembly: AssemblyCulture("")] … … 53 53 // by using the '*' as shown below: 54 54 [assembly: AssemblyVersion("3.4.0.0")] 55 [assembly: AssemblyFileVersion("3.4. 6.$WCREV$")]55 [assembly: AssemblyFileVersion("3.4.7.$WCREV$")] -
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectiveBoundedMeanSquaredErrorEvaluator.cs
r11185 r12694 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectiveEvaluator.cs
r11185 r12694 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectiveMeanSquaredErrorEvaluator.cs
r11185 r12694 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectiveOverfittingAnalyzer.cs
r11185 r12694 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectivePearsonRSquaredEvaluator.cs
r11185 r12694 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 57 57 OnlineCalculatorError errorState; 58 58 59 double r 2;59 double r; 60 60 if (applyLinearScaling) { 61 var r 2Calculator = new OnlinePearsonsRSquaredCalculator();62 CalculateWithScaling(targetValues, estimatedValues, lowerEstimationLimit, upperEstimationLimit, r 2Calculator, problemData.Dataset.Rows);63 errorState = r 2Calculator.ErrorState;64 r 2 = r2Calculator.RSquared;61 var rCalculator = new OnlinePearsonsRCalculator(); 62 CalculateWithScaling(targetValues, estimatedValues, lowerEstimationLimit, upperEstimationLimit, rCalculator, problemData.Dataset.Rows); 63 errorState = rCalculator.ErrorState; 64 r = rCalculator.R; 65 65 } else { 66 66 IEnumerable<double> boundedEstimatedValues = estimatedValues.LimitToRange(lowerEstimationLimit, upperEstimationLimit); 67 r 2 = OnlinePearsonsRSquaredCalculator.Calculate(targetValues, boundedEstimatedValues, out errorState);67 r = OnlinePearsonsRCalculator.Calculate(targetValues, boundedEstimatedValues, out errorState); 68 68 } 69 69 if (errorState != OnlineCalculatorError.None) return double.NaN; 70 return r 2;70 return r*r; 71 71 } 72 72 -
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectivePenaltyScoreEvaluator.cs
r11185 r12694 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectiveProblem.cs
r11185 r12694 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 22 22 using HeuristicLab.Common; 23 23 using HeuristicLab.Core; 24 using HeuristicLab.Optimization; 24 25 using HeuristicLab.Parameters; 25 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 26 27 27 28 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Classification { 28 [Item("Symbolic Classification Problem (single 29 [Item("Symbolic Classification Problem (single-objective)", "Represents a single objective symbolic classfication problem.")] 29 30 [StorableClass] 30 [Creatable( "Problems")]31 [Creatable(CreatableAttribute.Categories.GeneticProgrammingProblems, Priority = 120)] 31 32 public class SymbolicClassificationSingleObjectiveProblem : SymbolicDataAnalysisSingleObjectiveProblem<IClassificationProblemData, ISymbolicClassificationSingleObjectiveEvaluator, ISymbolicDataAnalysisSolutionCreator>, IClassificationProblem { 32 33 private const double PunishmentFactor = 10; … … 115 116 Operators.Add(new SymbolicClassificationSingleObjectiveTrainingParetoBestSolutionAnalyzer()); 116 117 Operators.Add(new SymbolicClassificationSingleObjectiveValidationParetoBestSolutionAnalyzer()); 118 Operators.Add(new SymbolicExpressionTreePhenotypicSimilarityCalculator()); 119 Operators.Add(new SymbolicClassificationPhenotypicDiversityAnalyzer(Operators.OfType<SymbolicExpressionTreePhenotypicSimilarityCalculator>())); 117 120 ParameterizeOperators(); 118 121 } … … 145 148 op.ModelCreatorParameter.ActualName = ModelCreatorParameter.Name; 146 149 } 150 151 foreach (var op in Operators.OfType<ISolutionSimilarityCalculator>()) { 152 op.SolutionVariableName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName; 153 op.QualityVariableName = Evaluator.QualityParameter.ActualName; 154 155 if (op is SymbolicExpressionTreePhenotypicSimilarityCalculator) { 156 var phenotypicSimilarityCalculator = (SymbolicExpressionTreePhenotypicSimilarityCalculator)op; 157 phenotypicSimilarityCalculator.ProblemData = ProblemData; 158 phenotypicSimilarityCalculator.Interpreter = SymbolicExpressionTreeInterpreter; 159 } 160 } 147 161 } 148 162 } -
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectiveTrainingBestSolutionAnalyzer.cs
r11185 r12694 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectiveTrainingParetoBestSolutionAnalyzer.cs
r11185 r12694 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectiveValidationBestSolutionAnalyzer.cs
r11185 r12694 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectiveValidationParetoBestSolutionAnalyzer.cs
r11185 r12694 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SymbolicClassificationModel.cs
r11185 r12694 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 41 41 : base(tree, interpreter, lowerEstimationLimit, upperEstimationLimit) { } 42 42 43 public abstract IEnumerable<double> GetEstimatedClassValues( Dataset dataset, IEnumerable<int> rows);43 public abstract IEnumerable<double> GetEstimatedClassValues(IDataset dataset, IEnumerable<int> rows); 44 44 public abstract void RecalculateModelParameters(IClassificationProblemData problemData, IEnumerable<int> rows); 45 45 -
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SymbolicClassificationPruningAnalyzer.cs
r10469 r12694 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 29 29 [StorableClass] 30 30 public sealed class SymbolicClassificationPruningAnalyzer : SymbolicDataAnalysisSingleObjectivePruningAnalyzer { 31 private const string ImpactValuesCalculatorParameterName = "ImpactValuesCalculator";32 31 private const string PruningOperatorParameterName = "PruningOperator"; 33 p rivate SymbolicClassificationPruningAnalyzer(SymbolicClassificationPruningAnalyzer original, Cloner cloner)34 : base(original, cloner) {32 public IValueParameter<SymbolicClassificationPruningOperator> PruningOperatorParameter { 33 get { return (IValueParameter<SymbolicClassificationPruningOperator>)Parameters[PruningOperatorParameterName]; } 35 34 } 36 public override IDeepCloneable Clone(Cloner cloner) { 37 return new SymbolicClassificationPruningAnalyzer(this, cloner); 35 36 protected override SymbolicDataAnalysisExpressionPruningOperator PruningOperator { 37 get { return PruningOperatorParameter.Value; } 38 38 } 39 40 private SymbolicClassificationPruningAnalyzer(SymbolicClassificationPruningAnalyzer original, Cloner cloner) : base(original, cloner) { } 41 public override IDeepCloneable Clone(Cloner cloner) { return new SymbolicClassificationPruningAnalyzer(this, cloner); } 39 42 40 43 [StorableConstructor] … … 42 45 43 46 public SymbolicClassificationPruningAnalyzer() { 44 Parameters.Add(new ValueParameter<SymbolicDataAnalysisSolutionImpactValuesCalculator>(ImpactValuesCalculatorParameterName, "The impact values calculator", new SymbolicClassificationSolutionImpactValuesCalculator())); 45 Parameters.Add(new ValueParameter<SymbolicDataAnalysisExpressionPruningOperator>(PruningOperatorParameterName, "The operator used to prune trees", new SymbolicClassificationPruningOperator())); 47 Parameters.Add(new ValueParameter<SymbolicDataAnalysisExpressionPruningOperator>(PruningOperatorParameterName, "The operator used to prune trees", new SymbolicClassificationPruningOperator(new SymbolicClassificationSolutionImpactValuesCalculator()))); 46 48 } 47 49 } -
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SymbolicClassificationPruningOperator.cs
r11026 r12694 2 2 3 3 /* HeuristicLab 4 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)4 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 5 5 * 6 6 * This file is part of HeuristicLab. … … 22 22 #endregion 23 23 24 using System.Collections.Generic; 24 25 using System.Linq; 25 26 using HeuristicLab.Common; 26 27 using HeuristicLab.Core; 28 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 27 29 using HeuristicLab.Parameters; 28 30 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 32 34 [Item("SymbolicClassificationPruningOperator", "An operator which prunes symbolic classificaton trees.")] 33 35 public class SymbolicClassificationPruningOperator : SymbolicDataAnalysisExpressionPruningOperator { 34 private const string ImpactValuesCalculatorParameterName = "ImpactValuesCalculator";35 36 private const string ModelCreatorParameterName = "ModelCreator"; 36 37 … … 41 42 #endregion 42 43 43 protected SymbolicClassificationPruningOperator(SymbolicClassificationPruningOperator original, Cloner cloner) 44 : base(original, cloner) { 45 } 46 47 public override IDeepCloneable Clone(Cloner cloner) { 48 return new SymbolicClassificationPruningOperator(this, cloner); 49 } 44 protected SymbolicClassificationPruningOperator(SymbolicClassificationPruningOperator original, Cloner cloner) : base(original, cloner) { } 45 public override IDeepCloneable Clone(Cloner cloner) { return new SymbolicClassificationPruningOperator(this, cloner); } 50 46 51 47 [StorableConstructor] 52 48 protected SymbolicClassificationPruningOperator(bool deserializing) : base(deserializing) { } 53 49 54 public SymbolicClassificationPruningOperator( ) {55 Parameters.Add(new ValueParameter<ISymbolicDataAnalysisSolutionImpactValuesCalculator>(ImpactValuesCalculatorParameterName, new SymbolicClassificationSolutionImpactValuesCalculator()));50 public SymbolicClassificationPruningOperator(ISymbolicDataAnalysisSolutionImpactValuesCalculator impactValuesCalculator) 51 : base(impactValuesCalculator) { 56 52 Parameters.Add(new LookupParameter<ISymbolicClassificationModelCreator>(ModelCreatorParameterName)); 57 53 } 58 54 59 protected override ISymbolicDataAnalysisModel CreateModel( ) {60 var model = ModelCreatorParameter.ActualValue.CreateSymbolicClassificationModel( SymbolicExpressionTree, Interpreter, EstimationLimits.Lower, EstimationLimits.Upper);61 var problemData = (IClassificationProblemData)ProblemData;62 var rows = problemData.TrainingIndices;63 model.RecalculateModelParameters( problemData, rows);55 protected override ISymbolicDataAnalysisModel CreateModel(ISymbolicExpressionTree tree, ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, IDataAnalysisProblemData problemData, DoubleLimit estimationLimits) { 56 var model = ModelCreatorParameter.ActualValue.CreateSymbolicClassificationModel(tree, interpreter, estimationLimits.Lower, estimationLimits.Upper); 57 var classificationProblemData = (IClassificationProblemData)problemData; 58 var rows = classificationProblemData.TrainingIndices; 59 model.RecalculateModelParameters(classificationProblemData, rows); 64 60 return model; 65 61 } … … 67 63 protected override double Evaluate(IDataAnalysisModel model) { 68 64 var classificationModel = (IClassificationModel)model; 69 var classificationProblemData = (IClassificationProblemData)ProblemData; 70 var trainingIndices = Enumerable.Range(FitnessCalculationPartition.Start, FitnessCalculationPartition.Size); 71 var estimatedValues = classificationModel.GetEstimatedClassValues(ProblemData.Dataset, trainingIndices); 72 var targetValues = ProblemData.Dataset.GetDoubleValues(classificationProblemData.TargetVariable, trainingIndices); 65 var classificationProblemData = (IClassificationProblemData)ProblemDataParameter.ActualValue; 66 var rows = Enumerable.Range(FitnessCalculationPartitionParameter.ActualValue.Start, FitnessCalculationPartitionParameter.ActualValue.Size); 67 68 return Evaluate(classificationModel, classificationProblemData, rows); 69 } 70 71 private static double Evaluate(IClassificationModel model, IClassificationProblemData problemData, IEnumerable<int> rows) { 72 var estimatedValues = model.GetEstimatedClassValues(problemData.Dataset, rows); 73 var targetValues = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, rows); 73 74 OnlineCalculatorError errorState; 74 75 var quality = OnlineAccuracyCalculator.Calculate(targetValues, estimatedValues, out errorState); … … 76 77 return quality; 77 78 } 79 80 public static ISymbolicExpressionTree Prune(ISymbolicExpressionTree tree, ISymbolicClassificationModelCreator modelCreator, 81 SymbolicClassificationSolutionImpactValuesCalculator impactValuesCalculator, ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, 82 IClassificationProblemData problemData, DoubleLimit estimationLimits, IEnumerable<int> rows, 83 double nodeImpactThreshold = 0.0, bool pruneOnlyZeroImpactNodes = false) { 84 var clonedTree = (ISymbolicExpressionTree)tree.Clone(); 85 var model = modelCreator.CreateSymbolicClassificationModel(clonedTree, interpreter, estimationLimits.Lower, estimationLimits.Upper); 86 87 var nodes = clonedTree.Root.GetSubtree(0).GetSubtree(0).IterateNodesPrefix().ToList(); 88 double quality = Evaluate(model, problemData, rows); 89 90 for (int i = 0; i < nodes.Count; ++i) { 91 var node = nodes[i]; 92 if (node is ConstantTreeNode) continue; 93 94 double impactValue, replacementValue; 95 impactValuesCalculator.CalculateImpactAndReplacementValues(model, node, problemData, rows, out impactValue, out replacementValue, quality); 96 97 if (pruneOnlyZeroImpactNodes && !impactValue.IsAlmost(0.0)) continue; 98 if (!pruneOnlyZeroImpactNodes && impactValue > nodeImpactThreshold) continue; 99 100 var constantNode = (ConstantTreeNode)node.Grammar.GetSymbol("Constant").CreateTreeNode(); 101 constantNode.Value = replacementValue; 102 103 ReplaceWithConstant(node, constantNode); 104 i += node.GetLength() - 1; // skip subtrees under the node that was folded 105 106 quality -= impactValue; 107 } 108 return model.SymbolicExpressionTree; 109 } 78 110 } 79 111 } -
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SymbolicClassificationSolution.cs
r11185 r12694 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 20 20 #endregion 21 21 22 using System.Linq; 22 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; 24 25 using HeuristicLab.Data; 26 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 25 27 using HeuristicLab.Optimization; 26 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 61 63 public SymbolicClassificationSolution(ISymbolicClassificationModel model, IClassificationProblemData problemData) 62 64 : base(model, problemData) { 65 foreach (var node in model.SymbolicExpressionTree.Root.IterateNodesPrefix().OfType<SymbolicExpressionTreeTopLevelNode>()) 66 node.SetGrammar(null); 67 63 68 Add(new Result(ModelLengthResultName, "Length of the symbolic classification model.", new IntValue())); 64 69 Add(new Result(ModelDepthResultName, "Depth of the symbolic classification model.", new IntValue())); -
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SymbolicClassificationSolutionImpactValuesCalculator.cs
r11185 r12694 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SymbolicDiscriminantFunctionClassificationModel.cs
r11185 r12694 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 88 88 var classValuesArr = classValues.ToArray(); 89 89 var thresholdsArr = thresholds.ToArray(); 90 if (thresholdsArr.Length != classValuesArr.Length || thresholdsArr.Length < 1) 90 if (thresholdsArr.Length != classValuesArr.Length || thresholdsArr.Length < 1) 91 91 throw new ArgumentException(); 92 if (!double.IsNegativeInfinity(thresholds.First())) 92 if (!double.IsNegativeInfinity(thresholds.First())) 93 93 throw new ArgumentException(); 94 94 … … 107 107 } 108 108 109 public IEnumerable<double> GetEstimatedValues( Dataset dataset, IEnumerable<int> rows) {109 public IEnumerable<double> GetEstimatedValues(IDataset dataset, IEnumerable<int> rows) { 110 110 return Interpreter.GetSymbolicExpressionTreeValues(SymbolicExpressionTree, dataset, rows).LimitToRange(LowerEstimationLimit, UpperEstimationLimit); 111 111 } 112 112 113 public override IEnumerable<double> GetEstimatedClassValues( Dataset dataset, IEnumerable<int> rows) {113 public override IEnumerable<double> GetEstimatedClassValues(IDataset dataset, IEnumerable<int> rows) { 114 114 if (!Thresholds.Any() && !ClassValues.Any()) throw new ArgumentException("No thresholds and class values were set for the current symbolic classification model."); 115 115 foreach (var x in GetEstimatedValues(dataset, rows)) { -
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SymbolicDiscriminantFunctionClassificationSolution.cs
r11185 r12694 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 24 24 using HeuristicLab.Core; 25 25 using HeuristicLab.Data; 26 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 26 27 using HeuristicLab.Optimization; 27 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 107 108 public SymbolicDiscriminantFunctionClassificationSolution(ISymbolicDiscriminantFunctionClassificationModel model, IClassificationProblemData problemData) 108 109 : base(model, problemData) { 110 foreach (var node in model.SymbolicExpressionTree.Root.IterateNodesPrefix().OfType<SymbolicExpressionTreeTopLevelNode>()) 111 node.SetGrammar(null); 112 109 113 Add(new Result(ModelLengthResultName, "Length of the symbolic classification model.", new IntValue())); 110 114 Add(new Result(ModelDepthResultName, "Depth of the symbolic classification model.", new IntValue())); 111 112 115 113 116 ResultCollection estimationLimitResults = new ResultCollection(); -
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SymbolicNearestNeighbourClassificationModel.cs
r11185 r12694 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 66 66 } 67 67 68 public override IEnumerable<double> GetEstimatedClassValues( Dataset dataset, IEnumerable<int> rows) {68 public override IEnumerable<double> GetEstimatedClassValues(IDataset dataset, IEnumerable<int> rows) { 69 69 var estimatedValues = Interpreter.GetSymbolicExpressionTreeValues(SymbolicExpressionTree, dataset, rows) 70 70 .LimitToRange(LowerEstimationLimit, UpperEstimationLimit);
Note: See TracChangeset
for help on using the changeset viewer.