- Timestamp:
- 08/31/12 13:52:24 (12 years ago)
- Location:
- trunk/sources
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/LinearDiscriminantAnalysis.cs
r8531 r8550 112 112 IEnumerable<int> rows) { 113 113 var model = new SymbolicDiscriminantFunctionClassificationModel(tree, interpreter); 114 SymbolicDiscriminantFunctionClassificationModel.SetAccuracyMaximizingThresholds(model,problemData);114 model.SetAccuracyMaximizingThresholds(problemData); 115 115 return model; 116 116 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/3.4/InteractiveSymbolicDiscriminantFunctionClassificationSolutionSimplifierView.cs
r8531 r8550 55 55 // However, since we automatically prune sub-trees based on the threshold reaching the maximum accuracy we must 56 56 // also use maximum accuracy threshold calculation here in order to prevent incoherent behavior of the simplifier. 57 SymbolicDiscriminantFunctionClassificationModel.SetAccuracyMaximizingThresholds(model,Content.ProblemData);57 model.SetAccuracyMaximizingThresholds(Content.ProblemData); 58 58 Content.Model = model; 59 59 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/MultiObjective/SymbolicClassificationMultiObjectiveTrainingBestSolutionAnalyzer.cs
r8531 r8550 79 79 if (ApplyLinearScaling.Value) SymbolicDiscriminantFunctionClassificationModel.Scale(model, ProblemDataParameter.ActualValue); 80 80 81 SymbolicDiscriminantFunctionClassificationModel.SetAccuracyMaximizingThresholds(model,ProblemDataParameter.ActualValue);81 model.SetAccuracyMaximizingThresholds(ProblemDataParameter.ActualValue); 82 82 return new SymbolicDiscriminantFunctionClassificationSolution(model, (IClassificationProblemData)ProblemDataParameter.ActualValue.Clone()); 83 83 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/MultiObjective/SymbolicClassificationMultiObjectiveValidationBestSolutionAnalyzer.cs
r8531 r8550 68 68 if (ApplyLinearScaling.Value) SymbolicDiscriminantFunctionClassificationModel.Scale(model, ProblemDataParameter.ActualValue); 69 69 70 SymbolicDiscriminantFunctionClassificationModel.SetAccuracyMaximizingThresholds(model,ProblemDataParameter.ActualValue);70 model.SetAccuracyMaximizingThresholds(ProblemDataParameter.ActualValue); 71 71 return new SymbolicDiscriminantFunctionClassificationSolution(model, (IClassificationProblemData)ProblemDataParameter.ActualValue.Clone()); 72 72 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectiveTrainingBestSolutionAnalyzer.cs
r8531 r8550 77 77 if (ApplyLinearScaling.Value) SymbolicDiscriminantFunctionClassificationModel.Scale(model, ProblemDataParameter.ActualValue); 78 78 79 SymbolicDiscriminantFunctionClassificationModel.SetAccuracyMaximizingThresholds(model,ProblemDataParameter.ActualValue);79 model.SetAccuracyMaximizingThresholds(ProblemDataParameter.ActualValue); 80 80 return new SymbolicDiscriminantFunctionClassificationSolution(model, (IClassificationProblemData)ProblemDataParameter.ActualValue.Clone()); 81 81 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectiveTrainingParetoBestSolutionAnalyzer.cs
r8531 r8550 62 62 if (ApplyLinearScaling.Value) SymbolicDiscriminantFunctionClassificationModel.Scale(model, ProblemDataParameter.ActualValue); 63 63 64 SymbolicDiscriminantFunctionClassificationModel.SetAccuracyMaximizingThresholds(model,ProblemDataParameter.ActualValue);64 model.SetAccuracyMaximizingThresholds(ProblemDataParameter.ActualValue); 65 65 return new SymbolicDiscriminantFunctionClassificationSolution(model, (IClassificationProblemData)ProblemDataParameter.ActualValue.Clone()); 66 66 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectiveValidationBestSolutionAnalyzer.cs
r8531 r8550 68 68 if (ApplyLinearScaling.Value) SymbolicDiscriminantFunctionClassificationModel.Scale(model, ProblemDataParameter.ActualValue); 69 69 70 SymbolicDiscriminantFunctionClassificationModel.SetAccuracyMaximizingThresholds(model,ProblemDataParameter.ActualValue);70 model.SetAccuracyMaximizingThresholds(ProblemDataParameter.ActualValue); 71 71 return new SymbolicDiscriminantFunctionClassificationSolution(model, (IClassificationProblemData)ProblemDataParameter.ActualValue.Clone()); 72 72 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectiveValidationParetoBestSolutionAnalyzer.cs
r8531 r8550 62 62 if (ApplyLinearScaling.Value) SymbolicDiscriminantFunctionClassificationModel.Scale(model, ProblemDataParameter.ActualValue); 63 63 64 SymbolicDiscriminantFunctionClassificationModel.SetAccuracyMaximizingThresholds(model,ProblemDataParameter.ActualValue);64 model.SetAccuracyMaximizingThresholds(ProblemDataParameter.ActualValue); 65 65 return new SymbolicDiscriminantFunctionClassificationSolution(model, (IClassificationProblemData)ProblemDataParameter.ActualValue.Clone()); 66 66 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SymbolicDiscriminantFunctionClassificationModel.cs
r8533 r8550 122 122 #endregion 123 123 124 public static void SetAccuracyMaximizingThresholds(IDiscriminantFunctionClassificationModel model,IClassificationProblemData problemData) {124 public void SetAccuracyMaximizingThresholds(IClassificationProblemData problemData) { 125 125 double[] classValues; 126 126 double[] thresholds; 127 127 var targetClassValues = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, problemData.TrainingIndices); 128 var estimatedTrainingValues = model.GetEstimatedValues(problemData.Dataset, problemData.TrainingIndices);128 var estimatedTrainingValues = GetEstimatedValues(problemData.Dataset, problemData.TrainingIndices); 129 129 AccuracyMaximizationThresholdCalculator.CalculateThresholds(problemData, estimatedTrainingValues, targetClassValues, out classValues, out thresholds); 130 130 131 model.SetThresholdsAndClassValues(thresholds, classValues);132 } 133 134 public static void SetClassDistributionCutPointThresholds(IDiscriminantFunctionClassificationModel model,IClassificationProblemData problemData) {131 SetThresholdsAndClassValues(thresholds, classValues); 132 } 133 134 public void SetClassDistributionCutPointThresholds(IClassificationProblemData problemData) { 135 135 double[] classValues; 136 136 double[] thresholds; 137 137 var targetClassValues = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, problemData.TrainingIndices); 138 var estimatedTrainingValues = model.GetEstimatedValues(problemData.Dataset, problemData.TrainingIndices);138 var estimatedTrainingValues = GetEstimatedValues(problemData.Dataset, problemData.TrainingIndices); 139 139 NormalDistributionCutPointsThresholdCalculator.CalculateThresholds(problemData, estimatedTrainingValues, targetClassValues, out classValues, out thresholds); 140 140 141 model.SetThresholdsAndClassValues(thresholds, classValues);141 SetThresholdsAndClassValues(thresholds, classValues); 142 142 } 143 143 -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/DiscriminantFunctionClassificationSolutionThresholdView.cs
r8139 r8550 238 238 double[] thresholds = Content.Model.Thresholds.ToArray(); 239 239 thresholds[classIndex] = e.NewLocationY; 240 Array.Sort(thresholds); 240 241 Content.Model.SetThresholdsAndClassValues(thresholds, Content.Model.ClassValues); 241 242 }
Note: See TracChangeset
for help on using the changeset viewer.