Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/04/11 15:38:16 (13 years ago)
Author:
mkommend
Message:

#1453: Renamed IOnlineEvaluator to IOnlineCalculator

Location:
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation
Files:
4 edited

Legend:

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

    r5894 r5942  
    8585      IEnumerable<double> originalTestClassValues = ProblemData.Dataset.GetEnumeratedVariableValues(ProblemData.TargetVariable, ProblemData.TestIndizes);
    8686
    87       OnlineEvaluatorError errorState;
    88       double trainingAccuracy = OnlineAccuracyEvaluator.Calculate(estimatedTrainingClassValues, originalTrainingClassValues, out errorState);
    89       if (errorState != OnlineEvaluatorError.None) trainingAccuracy = double.NaN;
    90       double testAccuracy = OnlineAccuracyEvaluator.Calculate(estimatedTestClassValues, originalTestClassValues, out errorState);
    91       if (errorState != OnlineEvaluatorError.None) testAccuracy = double.NaN;
     87      OnlineCalculatorError errorState;
     88      double trainingAccuracy = OnlineAccuracyCalculator.Calculate(estimatedTrainingClassValues, originalTrainingClassValues, out errorState);
     89      if (errorState != OnlineCalculatorError.None) trainingAccuracy = double.NaN;
     90      double testAccuracy = OnlineAccuracyCalculator.Calculate(estimatedTestClassValues, originalTestClassValues, out errorState);
     91      if (errorState != OnlineCalculatorError.None) testAccuracy = double.NaN;
    9292
    9393      TrainingAccuracy = trainingAccuracy;
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/DiscriminantFunctionClassificationSolution.cs

    r5894 r5942  
    105105      IEnumerable<double> originalTestValues = ProblemData.Dataset.GetEnumeratedVariableValues(ProblemData.TargetVariable, ProblemData.TestIndizes);
    106106
    107       OnlineEvaluatorError errorState;
    108       double trainingMSE = OnlineMeanSquaredErrorEvaluator.Calculate(estimatedTrainingValues, originalTrainingValues, out errorState);
    109       TrainingMeanSquaredError = errorState == OnlineEvaluatorError.None ? trainingMSE : double.NaN;
    110       double testMSE = OnlineMeanSquaredErrorEvaluator.Calculate(estimatedTestValues, originalTestValues, out errorState);
    111       TestMeanSquaredError = errorState == OnlineEvaluatorError.None ? testMSE : double.NaN;
     107      OnlineCalculatorError errorState;
     108      double trainingMSE = OnlineMeanSquaredErrorCalculator.Calculate(estimatedTrainingValues, originalTrainingValues, out errorState);
     109      TrainingMeanSquaredError = errorState == OnlineCalculatorError.None ? trainingMSE : double.NaN;
     110      double testMSE = OnlineMeanSquaredErrorCalculator.Calculate(estimatedTestValues, originalTestValues, out errorState);
     111      TestMeanSquaredError = errorState == OnlineCalculatorError.None ? testMSE : double.NaN;
    112112
    113       double trainingR2 = OnlinePearsonsRSquaredEvaluator.Calculate(estimatedTrainingValues, originalTrainingValues, out errorState);
    114       TrainingRSquared = errorState == OnlineEvaluatorError.None ? trainingR2 : double.NaN;
    115       double testR2 = OnlinePearsonsRSquaredEvaluator.Calculate(estimatedTestValues, originalTestValues, out errorState);
    116       TestRSquared = errorState == OnlineEvaluatorError.None ? testR2 : double.NaN;
     113      double trainingR2 = OnlinePearsonsRSquaredCalculator.Calculate(estimatedTrainingValues, originalTrainingValues, out errorState);
     114      TrainingRSquared = errorState == OnlineCalculatorError.None ? trainingR2 : double.NaN;
     115      double testR2 = OnlinePearsonsRSquaredCalculator.Calculate(estimatedTestValues, originalTestValues, out errorState);
     116      TestRSquared = errorState == OnlineCalculatorError.None ? testR2 : double.NaN;
    117117    }
    118118
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ThresholdCalculators/NormalDistributionCutPointsThresholdCalculator.cs

    r5894 r5942  
    6464        double classValue = group.Key;
    6565        double mean, variance;
    66         OnlineEvaluatorError meanErrorState, varianceErrorState;
     66        OnlineCalculatorError meanErrorState, varianceErrorState;
    6767        OnlineMeanAndVarianceCalculator.Calculate(estimatedClassValues, out mean, out variance, out meanErrorState, out varianceErrorState);
    6868
    69         if (meanErrorState == OnlineEvaluatorError.None && varianceErrorState == OnlineEvaluatorError.None) {
     69        if (meanErrorState == OnlineCalculatorError.None && varianceErrorState == OnlineCalculatorError.None) {
    7070          classMean[classValue] = mean;
    7171          classStdDev[classValue] = Math.Sqrt(variance);
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionSolution.cs

    r5894 r5942  
    4040    private const string TrainingRelativeErrorResultName = "Average relative error (training)";
    4141    private const string TestRelativeErrorResultName = "Average relative error (test)";
     42    private const string TrainingNormalizedMeanSquaredErrorResultName = "Normalized mean squared error (training)";
     43    private const string TestNormalizedMeanSquaredErrorResultName = "Normalized mean squared error (test)";
    4244
    4345    public new IRegressionModel Model {
     
    8183    }
    8284
     85    public double TrainingNormalizedMeanSquaredError {
     86      get { return ((DoubleValue)this[TrainingNormalizedMeanSquaredErrorResultName].Value).Value; }
     87      private set { ((DoubleValue)this[TrainingNormalizedMeanSquaredErrorResultName].Value).Value = value; }
     88    }
     89
     90    public double TestNormalizedMeanSquaredError {
     91      get { return ((DoubleValue)this[TestNormalizedMeanSquaredErrorResultName].Value).Value; }
     92      private set { ((DoubleValue)this[TestNormalizedMeanSquaredErrorResultName].Value).Value = value; }
     93    }
     94
    8395
    8496    [StorableConstructor]
     
    95107      Add(new Result(TrainingRelativeErrorResultName, "Average of the relative errors of the model output and the actual values on the training partition", new PercentValue()));
    96108      Add(new Result(TestRelativeErrorResultName, "Average of the relative errors of the model output and the actual values on the test partition", new PercentValue()));
     109      Add(new Result(TrainingNormalizedMeanSquaredErrorResultName, "", new DoubleValue()));
     110      Add(new Result(TestNormalizedMeanSquaredErrorResultName, "", new DoubleValue()));
    97111
    98112      RecalculateResults();
     
    114128      IEnumerable<double> originalTestValues = ProblemData.Dataset.GetEnumeratedVariableValues(ProblemData.TargetVariable, ProblemData.TestIndizes);
    115129
    116       OnlineEvaluatorError errorState;
    117       double trainingMSE = OnlineMeanSquaredErrorEvaluator.Calculate(estimatedTrainingValues, originalTrainingValues, out errorState);
    118       TrainingMeanSquaredError = errorState == OnlineEvaluatorError.None ? trainingMSE : double.NaN;
    119       double testMSE = OnlineMeanSquaredErrorEvaluator.Calculate(estimatedTestValues, originalTestValues, out errorState);
    120       TestMeanSquaredError = errorState == OnlineEvaluatorError.None ? testMSE : double.NaN;
     130      OnlineCalculatorError errorState;
     131      double trainingMSE = OnlineMeanSquaredErrorCalculator.Calculate(estimatedTrainingValues, originalTrainingValues, out errorState);
     132      TrainingMeanSquaredError = errorState == OnlineCalculatorError.None ? trainingMSE : double.NaN;
     133      double testMSE = OnlineMeanSquaredErrorCalculator.Calculate(estimatedTestValues, originalTestValues, out errorState);
     134      TestMeanSquaredError = errorState == OnlineCalculatorError.None ? testMSE : double.NaN;
    121135
    122       double trainingR2 = OnlinePearsonsRSquaredEvaluator.Calculate(estimatedTrainingValues, originalTrainingValues, out errorState);
    123       TrainingRSquared = errorState == OnlineEvaluatorError.None ? trainingR2 : double.NaN;
    124       double testR2 = OnlinePearsonsRSquaredEvaluator.Calculate(estimatedTestValues, originalTestValues, out errorState);
    125       TestRSquared = errorState == OnlineEvaluatorError.None ? testR2 : double.NaN;
     136      double trainingR2 = OnlinePearsonsRSquaredCalculator.Calculate(estimatedTrainingValues, originalTrainingValues, out errorState);
     137      TrainingRSquared = errorState == OnlineCalculatorError.None ? trainingR2 : double.NaN;
     138      double testR2 = OnlinePearsonsRSquaredCalculator.Calculate(estimatedTestValues, originalTestValues, out errorState);
     139      TestRSquared = errorState == OnlineCalculatorError.None ? testR2 : double.NaN;
    126140
    127       double trainingRelError = OnlineMeanAbsolutePercentageErrorEvaluator.Calculate(estimatedTrainingValues, originalTrainingValues, out errorState);
    128       TrainingRelativeError = errorState == OnlineEvaluatorError.None ? trainingRelError : double.NaN;
    129       double testRelError = OnlineMeanAbsolutePercentageErrorEvaluator.Calculate(estimatedTestValues, originalTestValues, out errorState);
    130       TestRelativeError = errorState == OnlineEvaluatorError.None ? testRelError : double.NaN;
     141      double trainingRelError = OnlineMeanAbsolutePercentageErrorCalculator.Calculate(estimatedTrainingValues, originalTrainingValues, out errorState);
     142      TrainingRelativeError = errorState == OnlineCalculatorError.None ? trainingRelError : double.NaN;
     143      double testRelError = OnlineMeanAbsolutePercentageErrorCalculator.Calculate(estimatedTestValues, originalTestValues, out errorState);
     144      TestRelativeError = errorState == OnlineCalculatorError.None ? testRelError : double.NaN;
     145
     146      double trainingNMSE = OnlineNormalizedMeanSquaredErrorCalculator.Calculate(estimatedTrainingValues, originalTrainingValues, out errorState);
     147      TrainingNormalizedMeanSquaredError = errorState == OnlineCalculatorError.None ? trainingNMSE : double.NaN;
     148      double testNMSE = OnlineNormalizedMeanSquaredErrorCalculator.Calculate(estimatedTestValues, originalTestValues, out errorState);
     149      TestNormalizedMeanSquaredError = errorState == OnlineCalculatorError.None ? testNMSE : double.NaN;
    131150    }
    132151
Note: See TracChangeset for help on using the changeset viewer.