Changeset 8585 for branches/HeuristicLab.Mono/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification
- Timestamp:
- 09/06/12 09:52:52 (12 years ago)
- Location:
- branches/HeuristicLab.Mono
- Files:
-
- 13 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Mono
-
branches/HeuristicLab.Mono/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification
- Property svn:mergeinfo changed
-
branches/HeuristicLab.Mono/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4
- Property svn:ignore
-
old new 1 *.user 2 Plugin.cs 1 3 bin 2 *.user3 HeuristicLabProblemsDataAnalysisSymbolicClassificationPlugin.cs4 4 obj 5 *.vs10x6 Plugin.cs
-
- Property svn:ignore
-
branches/HeuristicLab.Mono/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification-3.4.csproj
r8451 r8585 115 115 <Compile Include="MultiObjective\SymbolicClassificationMultiObjectiveValidationBestSolutionAnalyzer.cs" /> 116 116 <Compile Include="Plugin.cs" /> 117 <Compile Include="SingleObjective\SymbolicClassificationSingleObjectivePenaltyScoreEvaluator.cs" /> 117 118 <Compile Include="SingleObjective\SymbolicClassificationSingleObjectiveBoundedMeanSquaredErrorEvaluator.cs" /> 118 119 <Compile Include="SingleObjective\SymbolicClassificationSingleObjectiveOverfittingAnalyzer.cs" /> -
branches/HeuristicLab.Mono/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/MultiObjective/SymbolicClassificationMultiObjectiveTrainingBestSolutionAnalyzer.cs
r7259 r8585 77 77 protected override ISymbolicClassificationSolution CreateSolution(ISymbolicExpressionTree bestTree, double[] bestQuality) { 78 78 var model = new SymbolicDiscriminantFunctionClassificationModel((ISymbolicExpressionTree)bestTree.Clone(), SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper); 79 if (ApplyLinearScaling.Value) {80 SymbolicDiscriminantFunctionClassificationModel.Scale(model, ProblemDataParameter.ActualValue); 81 }79 if (ApplyLinearScaling.Value) SymbolicDiscriminantFunctionClassificationModel.Scale(model, ProblemDataParameter.ActualValue); 80 81 model.SetAccuracyMaximizingThresholds(ProblemDataParameter.ActualValue); 82 82 return new SymbolicDiscriminantFunctionClassificationSolution(model, (IClassificationProblemData)ProblemDataParameter.ActualValue.Clone()); 83 83 } -
branches/HeuristicLab.Mono/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/MultiObjective/SymbolicClassificationMultiObjectiveValidationBestSolutionAnalyzer.cs
r7259 r8585 66 66 protected override ISymbolicClassificationSolution CreateSolution(ISymbolicExpressionTree bestTree, double[] bestQualities) { 67 67 var model = new SymbolicDiscriminantFunctionClassificationModel((ISymbolicExpressionTree)bestTree.Clone(), SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper); 68 if (ApplyLinearScaling.Value) {69 SymbolicDiscriminantFunctionClassificationModel.Scale(model, ProblemDataParameter.ActualValue); 70 }68 if (ApplyLinearScaling.Value) SymbolicDiscriminantFunctionClassificationModel.Scale(model, ProblemDataParameter.ActualValue); 69 70 model.SetAccuracyMaximizingThresholds(ProblemDataParameter.ActualValue); 71 71 return new SymbolicDiscriminantFunctionClassificationSolution(model, (IClassificationProblemData)ProblemDataParameter.ActualValue.Clone()); 72 72 } -
branches/HeuristicLab.Mono/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/Plugin.cs.frame
r8246 r8585 28 28 [Plugin("HeuristicLab.Problems.DataAnalysis.Symbolic.Classification","Provides classes to perform symbolic classification (single- or multiobjective).", "3.4.3.$WCREV$")] 29 29 [PluginFile("HeuristicLab.Problems.DataAnalysis.Symbolic.Classification-3.4.dll", PluginFileType.Assembly)] 30 [PluginDependency("HeuristicLab.ALGLIB", "3. 5")]30 [PluginDependency("HeuristicLab.ALGLIB", "3.6.0")] 31 31 [PluginDependency("HeuristicLab.Analysis", "3.3")] 32 32 [PluginDependency("HeuristicLab.Common", "3.3")] -
branches/HeuristicLab.Mono/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectiveTrainingBestSolutionAnalyzer.cs
r7259 r8585 75 75 protected override ISymbolicClassificationSolution CreateSolution(ISymbolicExpressionTree bestTree, double bestQuality) { 76 76 var model = new SymbolicDiscriminantFunctionClassificationModel((ISymbolicExpressionTree)bestTree.Clone(), SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper); 77 if (ApplyLinearScaling.Value) {78 SymbolicDiscriminantFunctionClassificationModel.Scale(model, ProblemDataParameter.ActualValue); 79 }77 if (ApplyLinearScaling.Value) SymbolicDiscriminantFunctionClassificationModel.Scale(model, ProblemDataParameter.ActualValue); 78 79 model.SetAccuracyMaximizingThresholds(ProblemDataParameter.ActualValue); 80 80 return new SymbolicDiscriminantFunctionClassificationSolution(model, (IClassificationProblemData)ProblemDataParameter.ActualValue.Clone()); 81 81 } -
branches/HeuristicLab.Mono/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectiveTrainingParetoBestSolutionAnalyzer.cs
r8169 r8585 60 60 protected override ISymbolicClassificationSolution CreateSolution(ISymbolicExpressionTree bestTree) { 61 61 var model = new SymbolicDiscriminantFunctionClassificationModel((ISymbolicExpressionTree)bestTree.Clone(), SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper); 62 if (ApplyLinearScaling.Value) 63 SymbolicDiscriminantFunctionClassificationModel.Scale(model, ProblemDataParameter.ActualValue); 62 if (ApplyLinearScaling.Value) SymbolicDiscriminantFunctionClassificationModel.Scale(model, ProblemDataParameter.ActualValue); 63 64 model.SetAccuracyMaximizingThresholds(ProblemDataParameter.ActualValue); 64 65 return new SymbolicDiscriminantFunctionClassificationSolution(model, (IClassificationProblemData)ProblemDataParameter.ActualValue.Clone()); 65 66 } -
branches/HeuristicLab.Mono/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectiveValidationBestSolutionAnalyzer.cs
r7259 r8585 66 66 protected override ISymbolicClassificationSolution CreateSolution(ISymbolicExpressionTree bestTree, double bestQuality) { 67 67 var model = new SymbolicDiscriminantFunctionClassificationModel((ISymbolicExpressionTree)bestTree.Clone(), SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper); 68 if (ApplyLinearScaling.Value) {69 SymbolicDiscriminantFunctionClassificationModel.Scale(model, ProblemDataParameter.ActualValue); 70 }68 if (ApplyLinearScaling.Value) SymbolicDiscriminantFunctionClassificationModel.Scale(model, ProblemDataParameter.ActualValue); 69 70 model.SetAccuracyMaximizingThresholds(ProblemDataParameter.ActualValue); 71 71 return new SymbolicDiscriminantFunctionClassificationSolution(model, (IClassificationProblemData)ProblemDataParameter.ActualValue.Clone()); 72 72 } -
branches/HeuristicLab.Mono/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectiveValidationParetoBestSolutionAnalyzer.cs
r8169 r8585 60 60 protected override ISymbolicClassificationSolution CreateSolution(ISymbolicExpressionTree bestTree) { 61 61 var model = new SymbolicDiscriminantFunctionClassificationModel((ISymbolicExpressionTree)bestTree.Clone(), SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper); 62 if (ApplyLinearScaling.Value) 63 SymbolicDiscriminantFunctionClassificationModel.Scale(model, ProblemDataParameter.ActualValue); 62 if (ApplyLinearScaling.Value) SymbolicDiscriminantFunctionClassificationModel.Scale(model, ProblemDataParameter.ActualValue); 63 64 model.SetAccuracyMaximizingThresholds(ProblemDataParameter.ActualValue); 64 65 return new SymbolicDiscriminantFunctionClassificationSolution(model, (IClassificationProblemData)ProblemDataParameter.ActualValue.Clone()); 65 66 } -
branches/HeuristicLab.Mono/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SymbolicClassificationModel.cs
r7259 r8585 51 51 52 52 public ISymbolicClassificationSolution CreateClassificationSolution(IClassificationProblemData problemData) { 53 return new SymbolicClassificationSolution(this, problemData);53 return new SymbolicClassificationSolution(this, new ClassificationProblemData(problemData)); 54 54 } 55 55 IClassificationSolution IClassificationModel.CreateClassificationSolution(IClassificationProblemData problemData) { -
branches/HeuristicLab.Mono/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SymbolicDiscriminantFunctionClassificationModel.cs
r8139 r8585 67 67 double lowerEstimationLimit = double.MinValue, double upperEstimationLimit = double.MaxValue) 68 68 : base(tree, interpreter) { 69 th resholds = new double[] { double.NegativeInfinity };70 classValues = new double[] { 0.0 };69 this.thresholds = new double[0]; 70 this.classValues = new double[0]; 71 71 this.lowerEstimationLimit = lowerEstimationLimit; 72 72 this.upperEstimationLimit = upperEstimationLimit; … … 88 88 89 89 public IEnumerable<double> GetEstimatedValues(Dataset dataset, IEnumerable<int> rows) { 90 return Interpreter.GetSymbolicExpressionTreeValues(SymbolicExpressionTree, dataset, rows) 91 .LimitToRange(lowerEstimationLimit, upperEstimationLimit); 90 return Interpreter.GetSymbolicExpressionTreeValues(SymbolicExpressionTree, dataset, rows).LimitToRange(lowerEstimationLimit, upperEstimationLimit); 92 91 } 93 92 94 93 public IEnumerable<double> GetEstimatedClassValues(Dataset dataset, IEnumerable<int> rows) { 94 if (!Thresholds.Any() && !ClassValues.Any()) throw new ArgumentException("No thresholds and class values were set for the current symbolic classification model."); 95 95 foreach (var x in GetEstimatedValues(dataset, rows)) { 96 96 int classIndex = 0; … … 105 105 106 106 public SymbolicDiscriminantFunctionClassificationSolution CreateClassificationSolution(IClassificationProblemData problemData) { 107 return new SymbolicDiscriminantFunctionClassificationSolution(this, problemData);107 return new SymbolicDiscriminantFunctionClassificationSolution(this, new ClassificationProblemData(problemData)); 108 108 } 109 109 IClassificationSolution IClassificationModel.CreateClassificationSolution(IClassificationProblemData problemData) { … … 121 121 } 122 122 #endregion 123 124 public void SetAccuracyMaximizingThresholds(IClassificationProblemData problemData) { 125 double[] classValues; 126 double[] thresholds; 127 var targetClassValues = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, problemData.TrainingIndices); 128 var estimatedTrainingValues = GetEstimatedValues(problemData.Dataset, problemData.TrainingIndices); 129 AccuracyMaximizationThresholdCalculator.CalculateThresholds(problemData, estimatedTrainingValues, targetClassValues, out classValues, out thresholds); 130 131 SetThresholdsAndClassValues(thresholds, classValues); 132 } 133 134 public void SetClassDistributionCutPointThresholds(IClassificationProblemData problemData) { 135 double[] classValues; 136 double[] thresholds; 137 var targetClassValues = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, problemData.TrainingIndices); 138 var estimatedTrainingValues = GetEstimatedValues(problemData.Dataset, problemData.TrainingIndices); 139 NormalDistributionCutPointsThresholdCalculator.CalculateThresholds(problemData, estimatedTrainingValues, targetClassValues, out classValues, out thresholds); 140 141 SetThresholdsAndClassValues(thresholds, classValues); 142 } 123 143 124 144 public static void Scale(SymbolicDiscriminantFunctionClassificationModel model, IClassificationProblemData problemData) {
Note: See TracChangeset
for help on using the changeset viewer.