Changeset 4366 for branches/HeuristicLab.Classification/HeuristicLab.Problems.DataAnalysis.Classification
- Timestamp:
- 09/07/10 10:03:21 (14 years ago)
- Location:
- branches/HeuristicLab.Classification/HeuristicLab.Problems.DataAnalysis.Classification/3.3
- Files:
-
- 6 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Classification/HeuristicLab.Problems.DataAnalysis.Classification/3.3
- Property svn:ignore
-
old new 3 3 obj 4 4 HeuristicLabProblemsDataAnalysisClassifcationPlugin.cs 5 HeuristicLabProblemsDataAnalysisClassificationPlugin.cs
-
- Property svn:ignore
-
branches/HeuristicLab.Classification/HeuristicLab.Problems.DataAnalysis.Classification/3.3/HeuristicLab.Problems.DataAnalysis.Classification.csproj
r4323 r4366 38 38 <AssemblyOriginatorKeyFile>HeuristicLab.snk</AssemblyOriginatorKeyFile> 39 39 </PropertyGroup> 40 <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'"> 41 <DebugSymbols>true</DebugSymbols> 42 <OutputPath>bin\x64\Debug\</OutputPath> 43 <DefineConstants>DEBUG;TRACE</DefineConstants> 44 <DebugType>full</DebugType> 45 <PlatformTarget>x64</PlatformTarget> 46 <CodeAnalysisLogFile>bin\Debug\HeuristicLab.Problems.DataAnalysis.Classification-3.3.dll.CodeAnalysisLog.xml</CodeAnalysisLogFile> 47 <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression> 48 <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile> 49 <ErrorReport>prompt</ErrorReport> 50 <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> 51 <CodeAnalysisRuleSetDirectories>;c:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories> 52 <CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets> 53 <CodeAnalysisRuleDirectories>;c:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories> 54 <CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules> 55 </PropertyGroup> 56 <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'"> 57 <OutputPath>bin\x64\Release\</OutputPath> 58 <DefineConstants>TRACE</DefineConstants> 59 <Optimize>true</Optimize> 60 <DebugType>pdbonly</DebugType> 61 <PlatformTarget>x64</PlatformTarget> 62 <CodeAnalysisLogFile>bin\Release\HeuristicLab.Problems.DataAnalysis.Classification-3.3.dll.CodeAnalysisLog.xml</CodeAnalysisLogFile> 63 <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression> 64 <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile> 65 <ErrorReport>prompt</ErrorReport> 66 <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> 67 <CodeAnalysisRuleSetDirectories>;c:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories> 68 <CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets> 69 <CodeAnalysisRuleDirectories>;c:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories> 70 <CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules> 71 </PropertyGroup> 72 <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'"> 73 <DebugSymbols>true</DebugSymbols> 74 <OutputPath>bin\x86\Debug\</OutputPath> 75 <DefineConstants>DEBUG;TRACE</DefineConstants> 76 <DebugType>full</DebugType> 77 <PlatformTarget>x86</PlatformTarget> 78 <CodeAnalysisLogFile>bin\Debug\HeuristicLab.Problems.DataAnalysis.Classification-3.3.dll.CodeAnalysisLog.xml</CodeAnalysisLogFile> 79 <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression> 80 <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile> 81 <ErrorReport>prompt</ErrorReport> 82 <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> 83 <CodeAnalysisRuleSetDirectories>;c:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories> 84 <CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets> 85 <CodeAnalysisRuleDirectories>;c:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories> 86 <CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules> 87 </PropertyGroup> 88 <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'"> 89 <OutputPath>bin\x86\Release\</OutputPath> 90 <DefineConstants>TRACE</DefineConstants> 91 <Optimize>true</Optimize> 92 <DebugType>pdbonly</DebugType> 93 <PlatformTarget>x86</PlatformTarget> 94 <CodeAnalysisLogFile>bin\Release\HeuristicLab.Problems.DataAnalysis.Classification-3.3.dll.CodeAnalysisLog.xml</CodeAnalysisLogFile> 95 <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression> 96 <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile> 97 <ErrorReport>prompt</ErrorReport> 98 <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> 99 <CodeAnalysisRuleSetDirectories>;c:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories> 100 <CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets> 101 <CodeAnalysisRuleDirectories>;c:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories> 102 <CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules> 103 </PropertyGroup> 40 104 <ItemGroup> 105 <Reference Include="HeuristicLab.Analysis-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86" /> 41 106 <Reference Include="HeuristicLab.Collections-3.3"> 42 <HintPath> ..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Collections-3.3.dll</HintPath>107 <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Collections-3.3.dll</HintPath> 43 108 </Reference> 44 109 <Reference Include="HeuristicLab.Common-3.3"> 45 <HintPath> ..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Common-3.3.dll</HintPath>110 <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Common-3.3.dll</HintPath> 46 111 </Reference> 47 <Reference Include="HeuristicLab.Common.Resources-3.3, Version=3.2.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture= AMD64" />112 <Reference Include="HeuristicLab.Common.Resources-3.3, Version=3.2.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86" /> 48 113 <Reference Include="HeuristicLab.Core-3.3"> 49 <HintPath> ..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Core-3.3.dll</HintPath>114 <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Core-3.3.dll</HintPath> 50 115 </Reference> 51 116 <Reference Include="HeuristicLab.Data-3.3"> 52 <HintPath> ..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Data-3.3.dll</HintPath>117 <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Data-3.3.dll</HintPath> 53 118 </Reference> 54 <Reference Include="HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture= AMD64" />55 <Reference Include="HeuristicLab.Operators-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture= AMD64" />119 <Reference Include="HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86" /> 120 <Reference Include="HeuristicLab.Operators-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86" /> 56 121 <Reference Include="HeuristicLab.Optimization-3.3"> 57 <HintPath> ..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Optimization-3.3.dll</HintPath>122 <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Optimization-3.3.dll</HintPath> 58 123 </Reference> 59 124 <Reference Include="HeuristicLab.Parameters-3.3"> 60 <HintPath> ..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Parameters-3.3.dll</HintPath>125 <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Parameters-3.3.dll</HintPath> 61 126 </Reference> 62 127 <Reference Include="HeuristicLab.Persistence-3.3"> 63 <HintPath> ..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Persistence-3.3.dll</HintPath>128 <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Persistence-3.3.dll</HintPath> 64 129 </Reference> 65 130 <Reference Include="HeuristicLab.PluginInfrastructure-3.3"> 66 <HintPath> ..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>131 <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath> 67 132 </Reference> 68 133 <Reference Include="HeuristicLab.Problems.DataAnalysis-3.3"> 69 <HintPath>..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Problems.DataAnalysis-3.3.dll</HintPath> 134 <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Problems.DataAnalysis-3.3.dll</HintPath> 135 </Reference> 136 <Reference Include="HeuristicLab.Problems.DataAnalysis.Regression-3.3"> 137 <HintPath>..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Problems.DataAnalysis.Regression-3.3.dll</HintPath> 70 138 </Reference> 71 139 <Reference Include="System" /> … … 78 146 </ItemGroup> 79 147 <ItemGroup> 148 <Compile Include="ClassificationProblemData.cs" /> 149 <Compile Include="HeuristicLabProblemsDataAnalysisClassificationPlugin.cs" /> 150 <Compile Include="Interfaces\IClassificationSolution.cs" /> 80 151 <Compile Include="SingleObjectiveClassificationProblem.cs" /> 81 152 <Compile Include="ProblemBase\Problem.cs" /> 82 153 <Compile Include="Interfaces\ISymbolicClassificationEvaluator.cs" /> 83 <Compile Include="HeuristicLabProblemsDataAnalysisClassifcationPlugin.cs" />84 154 <Compile Include="Properties\AssemblyInfo.cs" /> 85 155 <Compile Include="ProblemBase\SingleObjectiveProblem.cs" /> 156 <Compile Include="Interfaces\ISymbolicClassificationAnalyzer.cs" /> 157 <Compile Include="Symbolic\Analyzer\ValidationBestSymbolicClassificationSolutionAnalyzer.cs" /> 158 <Compile Include="Symbolic\SymbolicClassificationSolution.cs" /> 86 159 <Compile Include="Symbolic\SingleObjectiveSymbolicClassificationEvaluator.cs" /> 87 160 <Compile Include="Symbolic\SymbolicClassificationMeanSquaredErrorEvaluator.cs" /> … … 93 166 <None Include="Properties\AssemblyInfo.frame" /> 94 167 </ItemGroup> 168 <ItemGroup /> 95 169 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> 96 170 <PropertyGroup> … … 101 175 102 176 call PreBuildEvent.cmd 103 SubWCRev "%25ProjectDir%25\" "%25ProjectDir%25HeuristicLabProblemsDataAnalysisClassificationPlugin.cs.frame" "%25ProjectDir%25\HeuristicLabProblemsDataAnalysisClassif cationPlugin.cs"</PreBuildEvent>177 SubWCRev "%25ProjectDir%25\" "%25ProjectDir%25HeuristicLabProblemsDataAnalysisClassificationPlugin.cs.frame" "%25ProjectDir%25\HeuristicLabProblemsDataAnalysisClassificationPlugin.cs"</PreBuildEvent> 104 178 </PropertyGroup> 105 179 <!-- To modify your build process, add your task inside one of the targets below and uncomment it. -
branches/HeuristicLab.Classification/HeuristicLab.Problems.DataAnalysis.Classification/3.3/HeuristicLabProblemsDataAnalysisClassificationPlugin.cs.frame
r4304 r4366 23 23 24 24 namespace HeuristicLab.Problems.DataAnalysis.Classification { 25 /// <summary>26 /// Plugin class for HeuristicLab.Algorithms.LocalSearch plugin.27 /// </summary>28 25 [Plugin("HeuristicLab.Problems.DataAnalysis.Classification", "3.3.0.$WCREV$")] 29 26 [PluginFile("HeuristicLab.Problems.DataAnalysis.Classification-3.3.dll", PluginFileType.Assembly)] -
branches/HeuristicLab.Classification/HeuristicLab.Problems.DataAnalysis.Classification/3.3/Interfaces/ISymbolicClassificationEvaluator.cs
r4323 r4366 30 30 ILookupParameter<ISymbolicExpressionTreeInterpreter> SymbolicExpressionTreeInterpreterParameter { get; } 31 31 ILookupParameter<SymbolicExpressionTree> SymbolicExpressionTreeParameter { get; } 32 ILookupParameter< DataAnalysisProblemData> RegressionProblemDataParameter { get; }32 ILookupParameter<ClassificationProblemData> RegressionProblemDataParameter { get; } 33 33 IValueLookupParameter<IntValue> SamplesStartParameter { get; } 34 34 IValueLookupParameter<IntValue> SamplesEndParameter { get; } … … 39 39 double Evaluate(ISymbolicExpressionTreeInterpreter interpreter, SymbolicExpressionTree tree, 40 40 double lowerEstimationLimit, double upperEstimationLimit, 41 Dataset dataset, string targetVariable, IEnumerable< int> rows);41 Dataset dataset, string targetVariable, IEnumerable<double> sortedClassValues, IEnumerable<int> rows); 42 42 } 43 43 } -
branches/HeuristicLab.Classification/HeuristicLab.Problems.DataAnalysis.Classification/3.3/SingleObjectiveClassificationProblem.cs
r4323 r4366 35 35 private const string ClassificationProblemDataParameterName = "ClassificationProblemData"; 36 36 37 public ValueParameter<DataAnalysisProblemData> ClassificationProblemDataParameter {38 get { return ( ValueParameter<DataAnalysisProblemData>)Parameters[ClassificationProblemDataParameterName]; }37 public IValueParameter<ClassificationProblemData> ClassificationProblemDataParameter { 38 get { return (IValueParameter<ClassificationProblemData>)Parameters[ClassificationProblemDataParameterName]; } 39 39 } 40 public DataAnalysisProblemData ClassificationProblemData {40 public ClassificationProblemData ClassificationProblemData { 41 41 get { return ClassificationProblemDataParameter.Value; } 42 42 set { ClassificationProblemDataParameter.Value = value; } … … 47 47 public SingleObjectiveClassificationProblem() 48 48 : base() { 49 Parameters.Add(new ValueParameter< DataAnalysisProblemData>(ClassificationProblemDataParameterName, "The data set, target variable and input variables of the data analysis problem."));50 ClassificationProblemData = new DataAnalysisProblemData();49 Parameters.Add(new ValueParameter<ClassificationProblemData>(ClassificationProblemDataParameterName, "The data set, target variable and input variables of the data analysis problem.")); 50 ClassificationProblemData = new ClassificationProblemData(); 51 51 RegisterParameterEvents(); 52 52 RegisterParameterValueEvents(); -
branches/HeuristicLab.Classification/HeuristicLab.Problems.DataAnalysis.Classification/3.3/Symbolic/SingleObjectiveSymbolicClassificationEvaluator.cs
r4323 r4366 61 61 } 62 62 63 public ILookupParameter< DataAnalysisProblemData> RegressionProblemDataParameter {64 get { return (ILookupParameter< DataAnalysisProblemData>)Parameters[RegressionProblemDataParameterName]; }63 public ILookupParameter<ClassificationProblemData> RegressionProblemDataParameter { 64 get { return (ILookupParameter<ClassificationProblemData>)Parameters[RegressionProblemDataParameterName]; } 65 65 } 66 66 … … 92 92 get { return SymbolicExpressionTreeParameter.ActualValue; } 93 93 } 94 public DataAnalysisProblemData RegressionProblemData {94 public ClassificationProblemData RegressionProblemData { 95 95 get { return RegressionProblemDataParameter.ActualValue; } 96 96 } … … 118 118 Parameters.Add(new LookupParameter<ISymbolicExpressionTreeInterpreter>(SymbolicExpressionTreeInterpreterParameterName, "The interpreter that should be used to calculate the output values of the symbolic expression tree.")); 119 119 Parameters.Add(new LookupParameter<SymbolicExpressionTree>(FunctionTreeParameterName, "The symbolic regression solution encoded as a symbolic expression tree.")); 120 Parameters.Add(new LookupParameter< DataAnalysisProblemData>(RegressionProblemDataParameterName, "The problem data on which the symbolic regression solution should be evaluated."));120 Parameters.Add(new LookupParameter<ClassificationProblemData>(RegressionProblemDataParameterName, "The problem data on which the symbolic regression solution should be evaluated.")); 121 121 Parameters.Add(new ValueLookupParameter<IntValue>(SamplesStartParameterName, "The start index of the dataset partition on which the symbolic regression solution should be evaluated.")); 122 122 Parameters.Add(new ValueLookupParameter<IntValue>(SamplesEndParameterName, "The end index of the dataset partition on which the symbolic regression solution should be evaluated.")); … … 139 139 int seed = Random.Next(); 140 140 IEnumerable<int> rows = GenerateRowsToEvaluate(seed, RelativeNumberOfEvaluatedSamples.Value, SamplesStart.Value, SamplesEnd.Value); 141 141 142 double quality = Evaluate(SymbolicExpressionTreeInterpreter, SymbolicExpressionTree, LowerEstimationLimit.Value, UpperEstimationLimit.Value, 142 RegressionProblemData.Dataset, 143 RegressionProblemData.TargetVariable.Value, rows); 143 RegressionProblemData.Dataset, RegressionProblemData.TargetVariable.Value, RegressionProblemData.SortedClassValues, rows); 144 144 QualityParameter.ActualValue = new DoubleValue(quality); 145 145 return base.Apply(); … … 157 157 Dataset dataset, 158 158 string targetVariable, 159 IEnumerable<double> sortedClassValues, 159 160 IEnumerable<int> rows); 160 161 } -
branches/HeuristicLab.Classification/HeuristicLab.Problems.DataAnalysis.Classification/3.3/Symbolic/SymbolicClassificationMeanSquaredErrorEvaluator.cs
r4323 r4366 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.Linq; 25 using HeuristicLab.Common; 24 26 using HeuristicLab.Core; 25 27 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; … … 37 39 } 38 40 39 public override double Evaluate(ISymbolicExpressionTreeInterpreter interpreter, SymbolicExpressionTree solution, double lowerEstimationLimit, double upperEstimationLimit, Dataset dataset, string targetVariable, IEnumerable< int> rows) {40 double mse = Calculate(interpreter, solution, lowerEstimationLimit, upperEstimationLimit, dataset, targetVariable, rows);41 public override double Evaluate(ISymbolicExpressionTreeInterpreter interpreter, SymbolicExpressionTree solution, double lowerEstimationLimit, double upperEstimationLimit, Dataset dataset, string targetVariable, IEnumerable<double> sortedClassValues, IEnumerable<int> rows) { 42 double mse = Calculate(interpreter, solution, lowerEstimationLimit, upperEstimationLimit, dataset, targetVariable, sortedClassValues, rows); 41 43 return mse; 42 44 } 43 45 44 public static double Calculate(ISymbolicExpressionTreeInterpreter interpreter, SymbolicExpressionTree solution, double lowerEstimationLimit, double upperEstimationLimit, Dataset dataset, string targetVariable, IEnumerable< int> rows) {46 public static double Calculate(ISymbolicExpressionTreeInterpreter interpreter, SymbolicExpressionTree solution, double lowerEstimationLimit, double upperEstimationLimit, Dataset dataset, string targetVariable, IEnumerable<double> sortedClassValues, IEnumerable<int> rows) { 45 47 IEnumerable<double> estimatedValues = interpreter.GetSymbolicExpressionTreeValues(solution, dataset, rows); 46 48 IEnumerable<double> originalValues = dataset.GetEnumeratedVariableValues(targetVariable, rows); … … 49 51 OnlineMeanSquaredErrorEvaluator mseEvaluator = new OnlineMeanSquaredErrorEvaluator(); 50 52 53 54 double firstClassValue = sortedClassValues.First(); 55 double lastClassValue = sortedClassValues.Last(); 51 56 while (originalEnumerator.MoveNext() && estimatedEnumerator.MoveNext()) { 52 57 double estimated = estimatedEnumerator.Current; … … 54 59 if (double.IsNaN(estimated)) 55 60 estimated = upperEstimationLimit; 61 else if (estimated < original && original.IsAlmost(firstClassValue)) 62 estimated = original; 63 else if (estimated > original && original.IsAlmost(lastClassValue)) 64 estimated = original; 56 65 else 57 66 estimated = Math.Min(upperEstimationLimit, Math.Max(lowerEstimationLimit, estimated)); -
branches/HeuristicLab.Classification/HeuristicLab.Problems.DataAnalysis.Classification/3.3/Symbolic/SymbolicClassificationProblem.cs
r4323 r4366 21 21 22 22 using System; 23 using System.Collections.Generic; 23 24 using System.Linq; 24 25 using HeuristicLab.Core; … … 28 29 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Creators; 29 30 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Interfaces; 31 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols; 30 32 using HeuristicLab.Parameters; 31 33 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 32 34 using HeuristicLab.PluginInfrastructure; 33 35 using HeuristicLab.Problems.DataAnalysis.Symbolic; 36 using HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols; 34 37 35 38 namespace HeuristicLab.Problems.DataAnalysis.Classification { … … 52 55 protected set { SymbolicExpressionTreeInterpreterParameter.Value = value; } 53 56 } 54 public ValueParameter<ISymbolicExpressionTreeInterpreter> SymbolicExpressionTreeInterpreterParameter {55 get { return ( ValueParameter<ISymbolicExpressionTreeInterpreter>)Parameters[SymbolicExpressionTreeInterpreterParameterName]; }57 public IValueParameter<ISymbolicExpressionTreeInterpreter> SymbolicExpressionTreeInterpreterParameter { 58 get { return (IValueParameter<ISymbolicExpressionTreeInterpreter>)Parameters[SymbolicExpressionTreeInterpreterParameterName]; } 56 59 } 57 60 … … 60 63 protected set { FunctionTreeGrammarParameter.Value = value; } 61 64 } 62 public ValueParameter<ISymbolicExpressionGrammar> FunctionTreeGrammarParameter {63 get { return ( ValueParameter<ISymbolicExpressionGrammar>)Parameters[FunctionTreeGrammarParameterName]; }65 public IValueParameter<ISymbolicExpressionGrammar> FunctionTreeGrammarParameter { 66 get { return (IValueParameter<ISymbolicExpressionGrammar>)Parameters[FunctionTreeGrammarParameterName]; } 64 67 } 65 68 … … 68 71 protected set { MaxExpressionLengthParameter.Value = value; } 69 72 } 70 public ValueParameter<IntValue> MaxExpressionLengthParameter {71 get { return ( ValueParameter<IntValue>)Parameters[MaxExpressionLengthParameterName]; }73 public IValueParameter<IntValue> MaxExpressionLengthParameter { 74 get { return (IValueParameter<IntValue>)Parameters[MaxExpressionLengthParameterName]; } 72 75 } 73 76 … … 84 87 protected set { UpperEstimationLimitParameter.Value = value; } 85 88 } 86 public ValueParameter<DoubleValue> UpperEstimationLimitParameter {87 get { return ( ValueParameter<DoubleValue>)Parameters[UpperEstimationLimitParameterName]; }89 public IValueParameter<DoubleValue> UpperEstimationLimitParameter { 90 get { return (IValueParameter<DoubleValue>)Parameters[UpperEstimationLimitParameterName]; } 88 91 } 89 92 … … 92 95 protected set { LowerEstimationLimitParameter.Value = value; } 93 96 } 94 public ValueParameter<DoubleValue> LowerEstimationLimitParameter {95 get { return ( ValueParameter<DoubleValue>)Parameters[LowerEstimationLimitParameterName]; }97 public IValueParameter<DoubleValue> LowerEstimationLimitParameter { 98 get { return (IValueParameter<DoubleValue>)Parameters[LowerEstimationLimitParameterName]; } 96 99 } 97 100 … … 100 103 protected set { MaxFunctionDefiningBranchesParameter.Value = value; } 101 104 } 102 public ValueParameter<IntValue> MaxFunctionDefiningBranchesParameter {103 get { return ( ValueParameter<IntValue>)Parameters[MaxFunctionDefiningBranchensParameterName]; }105 public IValueParameter<IntValue> MaxFunctionDefiningBranchesParameter { 106 get { return (IValueParameter<IntValue>)Parameters[MaxFunctionDefiningBranchensParameterName]; } 104 107 } 105 108 … … 108 111 protected set { MaxFunctionArgumentsParameter.Value = value; } 109 112 } 110 public ValueParameter<IntValue> MaxFunctionArgumentsParameter {111 get { return ( ValueParameter<IntValue>)Parameters[MaxFunctionArgumentsParameterName]; }113 public IValueParameter<IntValue> MaxFunctionArgumentsParameter { 114 get { return (IValueParameter<IntValue>)Parameters[MaxFunctionArgumentsParameterName]; } 112 115 } 113 116 … … 225 228 Operators.AddRange(ApplicationManager.Manager.GetInstances<ISymbolicExpressionTreeOperator>().OfType<IOperator>()); 226 229 Operators.Add(new MinAverageMaxSymbolicExpressionTreeSizeAnalyzer()); 230 Operators.Add(new ValidationBestSymbolicClassificationSolutionAnalyzer()); 227 231 } 228 232 … … 249 253 250 254 private void ParameterizeGrammar() { 255 List<LaggedVariable> laggedSymbols = FunctionTreeGrammar.Symbols.OfType<LaggedVariable>().ToList(); 256 foreach (Symbol symbol in laggedSymbols) 257 FunctionTreeGrammar.RemoveSymbol(symbol); 251 258 foreach (var varSymbol in FunctionTreeGrammar.Symbols.OfType<HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols.Variable>()) { 252 259 varSymbol.VariableNames = ClassificationProblemData.InputVariables.CheckedItems.Select(x => x.Value.Value); … … 287 294 288 295 private void ParameterizeAnalyzers() { 289 296 foreach (ISymbolicExpressionTreeAnalyzer analyzer in Operators.OfType<ISymbolicExpressionTreeAnalyzer>()) { 297 analyzer.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName; 298 var bestValidationSolutionAnalyzer = analyzer as ValidationBestSymbolicClassificationSolutionAnalyzer; 299 if (bestValidationSolutionAnalyzer != null) { 300 bestValidationSolutionAnalyzer.ClassificationProblemDataParameter.ActualName = ClassificationProblemDataParameter.Name; 301 bestValidationSolutionAnalyzer.UpperEstimationLimitParameter.ActualName = UpperEstimationLimitParameter.Name; 302 bestValidationSolutionAnalyzer.LowerEstimationLimitParameter.ActualName = LowerEstimationLimitParameter.Name; 303 bestValidationSolutionAnalyzer.SymbolicExpressionTreeInterpreterParameter.ActualName = SymbolicExpressionTreeInterpreterParameter.Name; 304 bestValidationSolutionAnalyzer.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName; 305 bestValidationSolutionAnalyzer.ValidationSamplesStartParameter.Value = ValidationSamplesStart; 306 bestValidationSolutionAnalyzer.ValidationSamplesEndParameter.Value = ValidationSamplesEnd; 307 } 308 } 290 309 } 291 310 #endregion
Note: See TracChangeset
for help on using the changeset viewer.