Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/06/12 17:50:17 (12 years ago)
Author:
gkronber
Message:

#1081: merged r7266:7459 from the trunk into the time series prognosis branch.

Location:
branches/HeuristicLab.TimeSeries
Files:
4 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.TimeSeries

  • branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis

  • branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis/3.4/HeuristicLab.Problems.DataAnalysis-3.4.csproj

    r7154 r7460  
    146146    <Compile Include="Interfaces\Regression\IRegressionEnsembleSolution.cs" />
    147147    <Compile Include="Implementation\Regression\RegressionSolutionBase.cs" />
     148    <Compile Include="OnlineCalculators\OnlineMeanErrorCalculator.cs" />
    148149    <Compile Include="OnlineCalculators\NormalizedGiniCalculator.cs" />
    149150    <Compile Include="Interfaces\TimeSeriesPrognosis\IOnlineTimeSeriesCalculator.cs" />
  • branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionSolutionBase.cs

    r7268 r7460  
    4040    private const string TrainingNormalizedMeanSquaredErrorResultName = "Normalized mean squared error (training)";
    4141    private const string TestNormalizedMeanSquaredErrorResultName = "Normalized mean squared error (test)";
     42    private const string TrainingMeanErrorResultName = "Mean error (training)";
     43    private const string TestMeanErrorResultName = "Mean error (test)";
    4244
    4345    public new IRegressionModel Model {
     
    9698      get { return ((DoubleValue)this[TestNormalizedMeanSquaredErrorResultName].Value).Value; }
    9799      private set { ((DoubleValue)this[TestNormalizedMeanSquaredErrorResultName].Value).Value = value; }
     100    }
     101    public double TrainingMeanError {
     102      get { return ((DoubleValue)this[TrainingMeanErrorResultName].Value).Value; }
     103      private set { ((DoubleValue)this[TrainingMeanErrorResultName].Value).Value = value; }
     104    }
     105    public double TestMeanError {
     106      get { return ((DoubleValue)this[TestMeanErrorResultName].Value).Value; }
     107      private set { ((DoubleValue)this[TestMeanErrorResultName].Value).Value = value; }
    98108    }
    99109    #endregion
     
    116126      Add(new Result(TrainingNormalizedMeanSquaredErrorResultName, "Normalized mean of squared errors of the model on the training partition", new DoubleValue()));
    117127      Add(new Result(TestNormalizedMeanSquaredErrorResultName, "Normalized mean of squared errors of the model on the test partition", new DoubleValue()));
     128      Add(new Result(TrainingMeanErrorResultName, "Mean of errors of the model on the training partition", new DoubleValue()));
     129      Add(new Result(TestMeanErrorResultName, "Mean of errors of the model on the test partition", new DoubleValue()));
    118130    }
    119131
     
    136148        double testMAE = OnlineMeanAbsoluteErrorCalculator.Calculate(EstimatedTestValues, ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TestIndizes), out errorState);
    137149        TestMeanAbsoluteError = errorState == OnlineCalculatorError.None ? testMAE : double.NaN;
     150      }
     151
     152      if (!ContainsKey(TrainingMeanErrorResultName)) {
     153        OnlineCalculatorError errorState;
     154        Add(new Result(TrainingMeanErrorResultName, "Mean of errors of the model on the training partition", new DoubleValue()));
     155        double trainingME = OnlineMeanErrorCalculator.Calculate(EstimatedTrainingValues, ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndizes), out errorState);
     156        TrainingMeanError = errorState == OnlineCalculatorError.None ? trainingME : double.NaN;
     157      }
     158      if (!ContainsKey(TestMeanErrorResultName)) {
     159        OnlineCalculatorError errorState;
     160        Add(new Result(TestMeanErrorResultName, "Mean of errors of the model on the test partition", new DoubleValue()));
     161        double testME = OnlineMeanErrorCalculator.Calculate(EstimatedTestValues, ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TestIndizes), out errorState);
     162        TestMeanError = errorState == OnlineCalculatorError.None ? testME : double.NaN;
    138163      }
    139164      #endregion
     
    171196      double testNMSE = OnlineNormalizedMeanSquaredErrorCalculator.Calculate(originalTestValues, estimatedTestValues, out errorState);
    172197      TestNormalizedMeanSquaredError = errorState == OnlineCalculatorError.None ? testNMSE : double.NaN;
     198
     199      double trainingME = OnlineMeanErrorCalculator.Calculate(originalTrainingValues, estimatedTrainingValues, out errorState);
     200      TrainingMeanError = errorState == OnlineCalculatorError.None ? trainingME : double.NaN;
     201      double testME = OnlineMeanErrorCalculator.Calculate(originalTestValues, estimatedTestValues, out errorState);
     202      TestMeanError = errorState == OnlineCalculatorError.None ? testME : double.NaN;
    173203    }
    174204  }
Note: See TracChangeset for help on using the changeset viewer.