- Timestamp:
- 08/09/11 11:01:08 (13 years ago)
- Location:
- branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis/3.4
- Files:
-
- 5 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis/3.4/HeuristicLab.Problems.DataAnalysis-3.4.csproj
r6618 r6647 139 139 <Compile Include="Interfaces\Regression\IRegressionEnsembleSolution.cs" /> 140 140 <Compile Include="Implementation\Regression\RegressionSolutionBase.cs" /> 141 <Compile Include="OnlineCalculators\OnlineMeanAbsoluteErrorCalculator.cs" /> 141 142 <Compile Include="OnlineCalculators\OnlineLinearScalingParameterCalculator.cs" /> 142 143 <Compile Include="Implementation\Classification\DiscriminantFunctionClassificationModel.cs" /> -
branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/DataAnalysisProblem.cs
r6618 r6647 72 72 private void RegisterEventHandlers() { 73 73 ProblemDataParameter.ValueChanged += new EventHandler(ProblemDataParameter_ValueChanged); 74 if (ProblemDataParameter.Value != null) ProblemDataParameter.Value.Changed += new EventHandler(ProblemData Parameter_ValueChanged);74 if (ProblemDataParameter.Value != null) ProblemDataParameter.Value.Changed += new EventHandler(ProblemData_Changed); 75 75 } 76 76 77 77 private void ProblemDataParameter_ValueChanged(object sender, EventArgs e) { 78 ProblemDataParameter.Value.Changed += new EventHandler(ProblemData Parameter_ValueChanged);78 ProblemDataParameter.Value.Changed += new EventHandler(ProblemData_Changed); 79 79 OnProblemDataChanged(); 80 OnReset(); 81 } 82 83 private void ProblemData_Changed(object sender, EventArgs e) { 80 84 OnReset(); 81 85 } -
branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionSolutionBase.cs
r6618 r6647 32 32 private const string TrainingMeanSquaredErrorResultName = "Mean squared error (training)"; 33 33 private const string TestMeanSquaredErrorResultName = "Mean squared error (test)"; 34 private const string TrainingMeanAbsoluteErrorResultName = "Mean absolute error (training)"; 35 private const string TestMeanAbsoluteErrorResultName = "Mean absolute error (test)"; 34 36 private const string TrainingSquaredCorrelationResultName = "Pearson's R² (training)"; 35 37 private const string TestSquaredCorrelationResultName = "Pearson's R² (test)"; … … 62 64 get { return ((DoubleValue)this[TestMeanSquaredErrorResultName].Value).Value; } 63 65 private set { ((DoubleValue)this[TestMeanSquaredErrorResultName].Value).Value = value; } 66 } 67 public double TrainingMeanAbsoluteError { 68 get { return ((DoubleValue)this[TrainingMeanAbsoluteErrorResultName].Value).Value; } 69 private set { ((DoubleValue)this[TrainingMeanAbsoluteErrorResultName].Value).Value = value; } 70 } 71 public double TestMeanAbsoluteError { 72 get { return ((DoubleValue)this[TestMeanAbsoluteErrorResultName].Value).Value; } 73 private set { ((DoubleValue)this[TestMeanAbsoluteErrorResultName].Value).Value = value; } 64 74 } 65 75 public double TrainingRSquared { … … 98 108 Add(new Result(TrainingMeanSquaredErrorResultName, "Mean of squared errors of the model on the training partition", new DoubleValue())); 99 109 Add(new Result(TestMeanSquaredErrorResultName, "Mean of squared errors of the model on the test partition", new DoubleValue())); 110 Add(new Result(TrainingMeanAbsoluteErrorResultName, "Mean of absolute errors of the model on the training partition", new DoubleValue())); 111 Add(new Result(TestMeanAbsoluteErrorResultName, "Mean of absolute errors of the model on the test partition", new DoubleValue())); 100 112 Add(new Result(TrainingSquaredCorrelationResultName, "Squared Pearson's correlation coefficient of the model output and the actual values on the training partition", new DoubleValue())); 101 113 Add(new Result(TestSquaredCorrelationResultName, "Squared Pearson's correlation coefficient of the model output and the actual values on the test partition", new DoubleValue())); … … 104 116 Add(new Result(TrainingNormalizedMeanSquaredErrorResultName, "Normalized mean of squared errors of the model on the training partition", new DoubleValue())); 105 117 Add(new Result(TestNormalizedMeanSquaredErrorResultName, "Normalized mean of squared errors of the model on the test partition", new DoubleValue())); 118 } 119 120 [StorableHook(HookType.AfterDeserialization)] 121 private void AfterDeserialization() { 122 // BackwardsCompatibility3.4 123 124 #region Backwards compatible code, remove with 3.5 125 126 if (!ContainsKey(TrainingMeanAbsoluteErrorResultName)) { 127 OnlineCalculatorError errorState; 128 Add(new Result(TrainingMeanAbsoluteErrorResultName, "Mean of absolute errors of the model on the training partition", new DoubleValue())); 129 double trainingMAE = OnlineMeanSquaredErrorCalculator.Calculate(EstimatedTrainingValues, ProblemData.Dataset.GetEnumeratedVariableValues(ProblemData.TargetVariable, ProblemData.TrainingIndizes), out errorState); 130 TrainingMeanAbsoluteError = errorState == OnlineCalculatorError.None ? trainingMAE : double.NaN; 131 } 132 133 if (!ContainsKey(TestMeanAbsoluteErrorResultName)) { 134 OnlineCalculatorError errorState; 135 Add(new Result(TestMeanAbsoluteErrorResultName, "Mean of absolute errors of the model on the test partition", new DoubleValue())); 136 double testMAE = OnlineMeanAbsoluteErrorCalculator.Calculate(EstimatedTestValues, ProblemData.Dataset.GetEnumeratedVariableValues(ProblemData.TargetVariable, ProblemData.TestIndizes), out errorState); 137 TestMeanAbsoluteError = errorState == OnlineCalculatorError.None ? testMAE : double.NaN; 138 } 139 #endregion 106 140 } 107 141 … … 117 151 double testMSE = OnlineMeanSquaredErrorCalculator.Calculate(estimatedTestValues, originalTestValues, out errorState); 118 152 TestMeanSquaredError = errorState == OnlineCalculatorError.None ? testMSE : double.NaN; 153 154 double trainingMAE = OnlineMeanAbsoluteErrorCalculator.Calculate(estimatedTrainingValues, originalTrainingValues, out errorState); 155 TrainingMeanAbsoluteError = errorState == OnlineCalculatorError.None ? trainingMAE : double.NaN; 156 double testMAE = OnlineMeanAbsoluteErrorCalculator.Calculate(estimatedTestValues, originalTestValues, out errorState); 157 TestMeanAbsoluteError = errorState == OnlineCalculatorError.None ? testMAE : double.NaN; 119 158 120 159 double trainingR2 = OnlinePearsonsRSquaredCalculator.Calculate(estimatedTrainingValues, originalTrainingValues, out errorState); -
branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Classification/IDiscriminantFunctionClassificationModel.cs
r6618 r6647 26 26 IEnumerable<double> Thresholds { get; } 27 27 IEnumerable<double> ClassValues { get; } 28 // class values and thresholds can only be assigned simultan iously28 // class values and thresholds can only be assigned simultanously 29 29 void SetThresholdsAndClassValues(IEnumerable<double> thresholds, IEnumerable<double> classValues); 30 30 IEnumerable<double> GetEstimatedValues(Dataset dataset, IEnumerable<int> rows); -
branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Regression/IRegressionSolution.cs
r6618 r6647 33 33 double TrainingMeanSquaredError { get; } 34 34 double TestMeanSquaredError { get; } 35 double TrainingMeanAbsoluteError { get; } 36 double TestMeanAbsoluteError { get; } 35 37 double TrainingRSquared { get; } 36 38 double TestRSquared { get; }
Note: See TracChangeset
for help on using the changeset viewer.