Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/22/10 11:22:49 (14 years ago)
Author:
mkommend
Message:

Preparation for cross validation - removed the test samples from the trainining samples and added ValidationPercentage parameter (ticket #1199).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Analyzers/RegressionSolutionAnalyzer.cs

    r4068 r4468  
    121121      var solution = bestSolution;
    122122      #region update R2,MSE, Rel Error
    123       IEnumerable<double> trainingValues = problemData.Dataset.GetEnumeratedVariableValues(
    124         problemData.TargetVariable.Value,
    125         problemData.TrainingSamplesStart.Value,
    126         problemData.TrainingSamplesEnd.Value);
    127       IEnumerable<double> testValues = problemData.Dataset.GetEnumeratedVariableValues(
    128         problemData.TargetVariable.Value,
    129         problemData.TestSamplesStart.Value,
    130         problemData.TestSamplesEnd.Value);
     123      IEnumerable<double> trainingValues = problemData.Dataset.GetEnumeratedVariableValues(problemData.TargetVariable.Value, problemData.TrainingIndizes);
     124      IEnumerable<double> testValues = problemData.Dataset.GetEnumeratedVariableValues(problemData.TargetVariable.Value, problemData.TestIndizes);
    131125      OnlineMeanSquaredErrorEvaluator mseEvaluator = new OnlineMeanSquaredErrorEvaluator();
    132126      OnlineMeanAbsolutePercentageErrorEvaluator relErrorEvaluator = new OnlineMeanAbsolutePercentageErrorEvaluator();
    133127      OnlinePearsonsRSquaredEvaluator r2Evaluator = new OnlinePearsonsRSquaredEvaluator();
     128
    134129      #region training
    135130      var originalEnumerator = trainingValues.GetEnumerator();
     
    144139      double trainingRelError = relErrorEvaluator.MeanAbsolutePercentageError;
    145140      #endregion
     141
    146142      mseEvaluator.Reset();
    147143      relErrorEvaluator.Reset();
    148144      r2Evaluator.Reset();
     145
    149146      #region test
    150147      originalEnumerator = testValues.GetEnumerator();
     
    159156      double testRelError = relErrorEvaluator.MeanAbsolutePercentageError;
    160157      #endregion
     158
    161159      if (results.ContainsKey(BestSolutionResultName)) {
    162160        results[BestSolutionResultName].Value = solution;
Note: See TracChangeset for help on using the changeset viewer.