Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/23/21 18:00:27 (3 years ago)
Author:
gkronber
Message:

#3120: create two separate results for Gini coefficients (one based on class values and one based on the discriminant function)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationSolutionBase.cs

    r17180 r17962  
    3434    private const string TrainingAccuracyResultName = "Accuracy (training)";
    3535    private const string TestAccuracyResultName = "Accuracy (test)";
    36     private const string TrainingNormalizedGiniCoefficientResultName = "Normalized Gini Coefficient (training)";
    37     private const string TestNormalizedGiniCoefficientResultName = "Normalized Gini Coefficient (test)";
     36    private const string TrainingNormalizedGiniCoefficientResultName = "Norm. Gini coeff. (training)";
     37    private const string TestNormalizedGiniCoefficientResultName = "Norm. Gini coeff. (test)";
    3838    private const string ClassificationPerformanceMeasuresResultName = "Classification Performance Measures";
    3939
     
    9797      if (string.IsNullOrEmpty(Model.TargetVariable))
    9898        Model.TargetVariable = this.ProblemData.TargetVariable;
    99 
    100       if (!this.ContainsKey(TrainingNormalizedGiniCoefficientResultName))
     99      var newResult = false;
     100      if (!this.ContainsKey(TrainingNormalizedGiniCoefficientResultName)) {
    101101        Add(new Result(TrainingNormalizedGiniCoefficientResultName, "Normalized Gini coefficient of the model on the training partition.", new DoubleValue()));
    102       if (!this.ContainsKey(TestNormalizedGiniCoefficientResultName))
     102        newResult = true;
     103      }
     104      if (!this.ContainsKey(TestNormalizedGiniCoefficientResultName)) {
    103105        Add(new Result(TestNormalizedGiniCoefficientResultName, "Normalized Gini coefficient of the model on the test partition.", new DoubleValue()));
     106        newResult = true;
     107      }
    104108      if (!this.ContainsKey(ClassificationPerformanceMeasuresResultName)) {
    105109        Add(new Result(ClassificationPerformanceMeasuresResultName, @"Classification performance measures.\n
    106110                              In a multiclass classification all misclassifications of the negative class will be treated as true negatives except on positive class estimations.",
    107111                              new ClassificationPerformanceMeasuresResultCollection()));
    108         CalculateClassificationResults();
     112        newResult = true;
    109113      }
     114      if (newResult) CalculateClassificationResults();
    110115    }
    111116
Note: See TracChangeset for help on using the changeset viewer.