Free cookie consent management tool by TermsFeed Policy Generator

Changeset 2428


Ignore:
Timestamp:
10/15/09 12:36:04 (15 years ago)
Author:
gkronber
Message:

Implemented #782 (Additional model quality metrics: Pearson product-moment correlation coefficient and Spearman's rank correlation coefficient)

Location:
trunk/sources/HeuristicLab.Modeling/3.2
Files:
6 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Modeling/3.2/HeuristicLab.Modeling-3.2.csproj

    r2388 r2428  
    8282  </ItemGroup>
    8383  <ItemGroup>
     84    <Compile Include="alglib\ap.cs" />
     85    <Compile Include="alglib\correlation.cs" />
    8486    <Compile Include="AnalyzerModel.cs" />
    8587    <Compile Include="BestSolutionStorer.cs" />
     88    <Compile Include="SimpleStableCorrelationCoefficientEvaluator.cs" />
     89    <Compile Include="SimplePearsonCorrelationCoefficientEvaluator.cs" />
     90    <Compile Include="SimpleSpearmansRankCorrelationCoefficientEvaluator.cs" />
    8691    <Compile Include="DefaultModelAnalyzerOperators.cs" />
    8792    <Compile Include="Matrix.cs" />
  • trunk/sources/HeuristicLab.Modeling/3.2/ModelingResult.cs

    r2379 r2428  
    4343    TestCoefficientOfDetermination,
    4444
     45    TrainingPearsonsCorrelationCoefficient,
     46    ValidationPearsonCorrelationCoefficient,
     47    TestPearsonCorrelationCoefficient,
     48
     49    TrainingStablePearsonsCorrelationCoefficient,
     50    ValidationStablePearsonCorrelationCoefficient,
     51    TestStablePearsonCorrelationCoefficient,
     52
     53    TrainingSpearmansRankCorrelationCoefficient,
     54    ValidationSpearmansRankCorrelationCoefficient,
     55    TestSpearmansRankCorrelationCoefficient,
     56
    4557    TrainingVarianceAccountedFor,
    4658    ValidationVarianceAccountedFor,
  • trunk/sources/HeuristicLab.Modeling/3.2/ModelingResultCalculators.cs

    r2397 r2428  
    5959          }
    6060        },
     61        { typeof(SimplePearsonCorrelationCoefficientEvaluator),
     62          new ModelingResult[] {
     63            ModelingResult.TrainingPearsonsCorrelationCoefficient,
     64            ModelingResult.ValidationPearsonCorrlationCoefficent,
     65            ModelingResult.TestPearsonCorrelationCoefficient
     66          }
     67        },
     68        { typeof(SimpleSpearmansRankCorrelationCoefficientEvaluator),
     69          new ModelingResult[] {
     70            ModelingResult.TrainingSpearmansRankCorrelationCoefficient,
     71            ModelingResult.ValidationSpearmansRankCorrelationCoefficient,
     72            ModelingResult.TestSpearmansRankCorrelationCoefficient
     73          }
     74        },
    6175        { typeof(SimpleVarianceAccountedForEvaluator),
    6276          new ModelingResult[] {
     
    148162      RegressionModelingResults[ModelingResult.ValidationCoefficientOfDetermination] = SimpleR2Evaluator.Calculate;
    149163      RegressionModelingResults[ModelingResult.TestCoefficientOfDetermination] = SimpleR2Evaluator.Calculate;
     164
     165      //Pearson Correlation Coefficient
     166      RegressionModelingResults[ModelingResult.TrainingPearsonsCorrelationCoefficient] = SimplePearsonCorrelationCoefficientEvaluator.Calculate;
     167      RegressionModelingResults[ModelingResult.ValidationPearsonCorrelationCoefficient] = SimplePearsonCorrelationCoefficientEvaluator.Calculate;
     168      RegressionModelingResults[ModelingResult.TestPearsonCorrelationCoefficient] = SimplePearsonCorrelationCoefficientEvaluator.Calculate;
     169
     170      //Stable Pearson Correlation Coefficient
     171      RegressionModelingResults[ModelingResult.TrainingStablePearsonsCorrelationCoefficient] = SimpleStableCorrelationCoefficientEvaluator.Calculate;
     172      RegressionModelingResults[ModelingResult.ValidationStablePearsonCorrelationCoefficient] = SimpleStableCorrelationCoefficientEvaluator.Calculate;
     173      RegressionModelingResults[ModelingResult.TestStablePearsonCorrelationCoefficient] = SimpleStableCorrelationCoefficientEvaluator.Calculate;
     174
     175      //Spearman's rank correlation coefficient
     176      RegressionModelingResults[ModelingResult.TrainingSpearmansRankCorrelationCoefficient] = SimpleSpearmansRankCorrelationCoefficientEvaluator.Calculate;
     177      RegressionModelingResults[ModelingResult.ValidationSpearmansRankCorrelationCoefficient] = SimpleSpearmansRankCorrelationCoefficientEvaluator.Calculate;
     178      RegressionModelingResults[ModelingResult.TestSpearmansRankCorrelationCoefficient] = SimpleSpearmansRankCorrelationCoefficientEvaluator.Calculate;
    150179
    151180      //Variance accounted for
  • trunk/sources/HeuristicLab.Modeling/3.2/SimpleR2Evaluator.cs

    r2357 r2428  
    4848          double target = values[i, ORIGINAL_INDEX];
    4949          if (!double.IsNaN(target) && !double.IsInfinity(target)) {
    50             target = target - targetMean;
    51             target = target * target;
    52             targetDeviationTotalSumOfSquares += target;
     50            double targetDiff = target - targetMean;
     51            targetDeviationTotalSumOfSquares += targetDiff * targetDiff;
    5352          }
    5453        }
Note: See TracChangeset for help on using the changeset viewer.