Changeset 6913 for trunk/sources
- Timestamp:
- 10/12/11 19:24:45 (13 years ago)
- Location:
- trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/HeuristicLab.Problems.DataAnalysis-3.4.csproj
r6866 r6913 147 147 <Compile Include="Interfaces\TimeSeriesPrognosis\ITimeSeriesPrognosisProblemData.cs" /> 148 148 <Compile Include="Interfaces\TimeSeriesPrognosis\ITimeSeriesPrognosisSolution.cs" /> 149 <Compile Include="OnlineCalculators\NormalizedGiniCalculator.cs" /> 149 150 <Compile Include="OnlineCalculators\OnlineDirectionalSymmetryCalculator.cs" /> 150 151 <Compile Include="OnlineCalculators\OnlineMeanAbsoluteErrorCalculator.cs" /> -
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationSolutionBase.cs
r6740 r6913 32 32 private const string TrainingAccuracyResultName = "Accuracy (training)"; 33 33 private const string TestAccuracyResultName = "Accuracy (test)"; 34 private const string TrainingNormalizedGiniCoefficientResultName = "Normalized Gini Coefficient (training)"; 35 private const string TestNormalizedGiniCoefficientResultName = "Normalized Gini Coefficient (test)"; 34 36 35 37 public new IClassificationModel Model { … … 52 54 private set { ((DoubleValue)this[TestAccuracyResultName].Value).Value = value; } 53 55 } 56 public double TrainingNormalizedGiniCoefficient { 57 get { return ((DoubleValue)this[TrainingNormalizedGiniCoefficientResultName].Value).Value; } 58 protected set { ((DoubleValue)this[TrainingNormalizedGiniCoefficientResultName].Value).Value = value; } 59 } 60 public double TestNormalizedGiniCoefficient { 61 get { return ((DoubleValue)this[TestNormalizedGiniCoefficientResultName].Value).Value; } 62 protected set { ((DoubleValue)this[TestNormalizedGiniCoefficientResultName].Value).Value = value; } 63 } 54 64 #endregion 55 65 … … 63 73 Add(new Result(TrainingAccuracyResultName, "Accuracy of the model on the training partition (percentage of correctly classified instances).", new PercentValue())); 64 74 Add(new Result(TestAccuracyResultName, "Accuracy of the model on the test partition (percentage of correctly classified instances).", new PercentValue())); 75 Add(new Result(TrainingNormalizedGiniCoefficientResultName, "Normalized Gini coefficient of the model on the training partition.", new DoubleValue())); 76 Add(new Result(TestNormalizedGiniCoefficientResultName, "Normalized Gini coefficient of the model on the test partition.", new DoubleValue())); 65 77 } 66 78 … … 79 91 TrainingAccuracy = trainingAccuracy; 80 92 TestAccuracy = testAccuracy; 93 94 double trainingNormalizedGini = NormalizedGiniCalculator.Calculate(originalTrainingClassValues, estimatedTrainingClassValues, out errorState); 95 if (errorState != OnlineCalculatorError.None) trainingNormalizedGini = double.NaN; 96 double testNormalizedGini = NormalizedGiniCalculator.Calculate(originalTestClassValues, estimatedTestClassValues, out errorState); 97 if (errorState != OnlineCalculatorError.None) testNormalizedGini = double.NaN; 98 99 TrainingNormalizedGiniCoefficient = trainingNormalizedGini; 100 TestNormalizedGiniCoefficient = testNormalizedGini; 81 101 } 82 102 -
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/DiscriminantFunctionClassificationSolutionBase.cs
r6740 r6913 117 117 double testR2 = OnlinePearsonsRSquaredCalculator.Calculate(estimatedTestValues, originalTestValues, out errorState); 118 118 TestRSquared = errorState == OnlineCalculatorError.None ? testR2 : double.NaN; 119 120 double trainingNormalizedGini = NormalizedGiniCalculator.Calculate(originalTrainingValues, estimatedTrainingValues, out errorState); 121 if (errorState != OnlineCalculatorError.None) trainingNormalizedGini = double.NaN; 122 double testNormalizedGini = NormalizedGiniCalculator.Calculate(originalTestValues, estimatedTestValues, out errorState); 123 if (errorState != OnlineCalculatorError.None) testNormalizedGini = double.NaN; 124 125 TrainingNormalizedGiniCoefficient = trainingNormalizedGini; 126 TestNormalizedGiniCoefficient = testNormalizedGini; 119 127 } 120 128
Note: See TracChangeset
for help on using the changeset viewer.