Changeset 11685 for branches/Classification-Extensions
- Timestamp:
- 12/16/14 12:09:48 (10 years ago)
- Location:
- branches/Classification-Extensions/HeuristicLab.Problems.DataAnalysis/3.4
- Files:
-
- 1 added
- 1 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Classification-Extensions/HeuristicLab.Problems.DataAnalysis/3.4/HeuristicLab.Problems.DataAnalysis-3.4.csproj
r11684 r11685 175 175 </Compile> 176 176 <Compile Include="Implementation\Classification\ClassificationEnsembleSolution.cs" /> 177 <Compile Include="Implementation\Classification\ClassificationPerformanceMeasures ResultCollection.cs" />177 <Compile Include="Implementation\Classification\ClassificationPerformanceMeasures.cs" /> 178 178 <Compile Include="Implementation\Classification\ClassificationProblemData.cs" /> 179 179 <Compile Include="Implementation\Classification\ClassificationProblem.cs" /> -
branches/Classification-Extensions/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationSolutionBase.cs
r11684 r11685 108 108 var positiveClassName = ProblemData.PositiveClassName; 109 109 double positiveClassValue = ProblemData.GetClassValue(positiveClassName); 110 ClassificationPerformanceMeasures.ClassificationPositiveClassValue = positiveClassName; 111 ClassificationPerformanceMeasuresCalculator trainingPerformanceCalculator = new ClassificationPerformanceMeasuresCalculator(positiveClassValue); 112 ClassificationPerformanceMeasuresCalculator testPerformanceCalculator = new ClassificationPerformanceMeasuresCalculator(positiveClassValue); 110 ClassificationPerformanceMeasuresCalculator trainingPerformanceCalculator = new ClassificationPerformanceMeasuresCalculator(positiveClassName, positiveClassValue); 111 ClassificationPerformanceMeasuresCalculator testPerformanceCalculator = new ClassificationPerformanceMeasuresCalculator(positiveClassName, positiveClassValue); 113 112 114 113 OnlineCalculatorError errorState; … … 130 129 131 130 trainingPerformanceCalculator.Calculate(originalTrainingClassValues, estimatedTrainingClassValues, out errorState); 132 if (errorState == OnlineCalculatorError.None) { 133 ClassificationPerformanceMeasures.TrainingTruePositiveRate = trainingPerformanceCalculator.TruePositiveRate; 134 ClassificationPerformanceMeasures.TrainingTrueNegativeRate = trainingPerformanceCalculator.TrueNegativeRate; 135 ClassificationPerformanceMeasures.TrainingPositivePredictiveValue = trainingPerformanceCalculator.PositivePredictiveValue; 136 ClassificationPerformanceMeasures.TrainingNegativePredictiveValue = trainingPerformanceCalculator.NegativePredictiveValue; 137 ClassificationPerformanceMeasures.TrainingFalsePositiveRate = trainingPerformanceCalculator.FalsePositiveRate; 138 ClassificationPerformanceMeasures.TrainingFalseDiscoveryRate = trainingPerformanceCalculator.FalseDiscoveryRate; 139 } 131 if (errorState == OnlineCalculatorError.None) 132 ClassificationPerformanceMeasures.SetTrainingResults(trainingPerformanceCalculator); 140 133 testPerformanceCalculator.Calculate(originalTestClassValues, estimatedTestClassValues, out errorState); 141 if (errorState == OnlineCalculatorError.None) { 142 ClassificationPerformanceMeasures.TestTruePositiveRate = testPerformanceCalculator.TruePositiveRate; 143 ClassificationPerformanceMeasures.TestTrueNegativeRate = testPerformanceCalculator.TrueNegativeRate; 144 ClassificationPerformanceMeasures.TestPositivePredictiveValue = testPerformanceCalculator.PositivePredictiveValue; 145 ClassificationPerformanceMeasures.TestNegativePredictiveValue = testPerformanceCalculator.NegativePredictiveValue; 146 ClassificationPerformanceMeasures.TestFalsePositiveRate = testPerformanceCalculator.FalsePositiveRate; 147 ClassificationPerformanceMeasures.TestFalseDiscoveryRate = testPerformanceCalculator.FalseDiscoveryRate; 148 } 134 if (errorState == OnlineCalculatorError.None) 135 ClassificationPerformanceMeasures.SetTestResults(testPerformanceCalculator); 149 136 } 150 137 -
branches/Classification-Extensions/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/ClassificationPerformanceMeasuresCalculator.cs
r11683 r11685 29 29 public class ClassificationPerformanceMeasuresCalculator { 30 30 31 public ClassificationPerformanceMeasuresCalculator(double positiveClassValue) { 31 public ClassificationPerformanceMeasuresCalculator(string positiveClassName, double positiveClassValue) { 32 this.positiveClassName = positiveClassName; 32 33 this.positiveClassValue = positiveClassValue; 33 34 Reset(); … … 35 36 36 37 #region Properties 38 private string positiveClassName; 37 39 private double positiveClassValue; 38 40 private int truePositiveCount, falsePositiveCount, trueNegativeCount, falseNegativeCount; 39 41 42 public string PositiveClassName { 43 get { 44 return positiveClassName; 45 } 46 } 47 public double PositiveClassValue { 48 get { 49 return positiveClassValue; 50 } 51 } 40 52 public double TruePositiveRate { 41 53 get {
Note: See TracChangeset
for help on using the changeset viewer.