- Timestamp:
- 06/27/12 17:34:17 (12 years ago)
- Location:
- trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionEnsembleSolution.cs
r7738 r8139 153 153 public override IEnumerable<double> EstimatedTrainingValues { 154 154 get { 155 var rows = ProblemData.TrainingIndi zes;155 var rows = ProblemData.TrainingIndices; 156 156 var estimatedValuesEnumerators = (from model in Model.Models 157 157 select new { Model = model, EstimatedValuesEnumerator = model.GetEstimatedValues(ProblemData.Dataset, rows).GetEnumerator() }) … … 172 172 public override IEnumerable<double> EstimatedTestValues { 173 173 get { 174 var rows = ProblemData.TestIndi zes;174 var rows = ProblemData.TestIndices; 175 175 var estimatedValuesEnumerators = (from model in Model.Models 176 176 select new { Model = model, EstimatedValuesEnumerator = model.GetEstimatedValues(ProblemData.Dataset, rows).GetEnumerator() }) 177 177 .ToList(); 178 var rowsEnumerator = ProblemData.TestIndi zes.GetEnumerator();178 var rowsEnumerator = ProblemData.TestIndices.GetEnumerator(); 179 179 // aggregate to make sure that MoveNext is called for all enumerators 180 180 while (rowsEnumerator.MoveNext() & estimatedValuesEnumerators.Select(en => en.EstimatedValuesEnumerator.MoveNext()).Aggregate(true, (acc, b) => acc & b)) { -
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionSolution.cs
r7735 r8139 55 55 } 56 56 public override IEnumerable<double> EstimatedTrainingValues { 57 get { return GetEstimatedValues(ProblemData.TrainingIndi zes); }57 get { return GetEstimatedValues(ProblemData.TrainingIndices); } 58 58 } 59 59 public override IEnumerable<double> EstimatedTestValues { 60 get { return GetEstimatedValues(ProblemData.TestIndi zes); }60 get { return GetEstimatedValues(ProblemData.TestIndices); } 61 61 } 62 62 -
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionSolutionBase.cs
r7735 r8139 138 138 OnlineCalculatorError errorState; 139 139 Add(new Result(TrainingMeanAbsoluteErrorResultName, "Mean of absolute errors of the model on the training partition", new DoubleValue())); 140 double trainingMAE = OnlineMeanAbsoluteErrorCalculator.Calculate(EstimatedTrainingValues, ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndi zes), out errorState);140 double trainingMAE = OnlineMeanAbsoluteErrorCalculator.Calculate(EstimatedTrainingValues, ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndices), out errorState); 141 141 TrainingMeanAbsoluteError = errorState == OnlineCalculatorError.None ? trainingMAE : double.NaN; 142 142 } … … 145 145 OnlineCalculatorError errorState; 146 146 Add(new Result(TestMeanAbsoluteErrorResultName, "Mean of absolute errors of the model on the test partition", new DoubleValue())); 147 double testMAE = OnlineMeanAbsoluteErrorCalculator.Calculate(EstimatedTestValues, ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TestIndi zes), out errorState);147 double testMAE = OnlineMeanAbsoluteErrorCalculator.Calculate(EstimatedTestValues, ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TestIndices), out errorState); 148 148 TestMeanAbsoluteError = errorState == OnlineCalculatorError.None ? testMAE : double.NaN; 149 149 } … … 152 152 OnlineCalculatorError errorState; 153 153 Add(new Result(TrainingMeanErrorResultName, "Mean of errors of the model on the training partition", new DoubleValue())); 154 double trainingME = OnlineMeanErrorCalculator.Calculate(EstimatedTrainingValues, ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndi zes), out errorState);154 double trainingME = OnlineMeanErrorCalculator.Calculate(EstimatedTrainingValues, ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndices), out errorState); 155 155 TrainingMeanError = errorState == OnlineCalculatorError.None ? trainingME : double.NaN; 156 156 } … … 158 158 OnlineCalculatorError errorState; 159 159 Add(new Result(TestMeanErrorResultName, "Mean of errors of the model on the test partition", new DoubleValue())); 160 double testME = OnlineMeanErrorCalculator.Calculate(EstimatedTestValues, ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TestIndi zes), out errorState);160 double testME = OnlineMeanErrorCalculator.Calculate(EstimatedTestValues, ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TestIndices), out errorState); 161 161 TestMeanError = errorState == OnlineCalculatorError.None ? testME : double.NaN; 162 162 } … … 166 166 protected void CalculateResults() { 167 167 IEnumerable<double> estimatedTrainingValues = EstimatedTrainingValues; // cache values 168 IEnumerable<double> originalTrainingValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndi zes);168 IEnumerable<double> originalTrainingValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndices); 169 169 IEnumerable<double> estimatedTestValues = EstimatedTestValues; // cache values 170 IEnumerable<double> originalTestValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TestIndi zes);170 IEnumerable<double> originalTestValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TestIndices); 171 171 172 172 OnlineCalculatorError errorState;
Note: See TracChangeset
for help on using the changeset viewer.