Changeset 8742 for branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression
- Timestamp:
- 10/05/12 11:58:17 (12 years ago)
- Location:
- branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/ConstantRegressionModel.cs
r8458 r8742 55 55 56 56 public IRegressionSolution CreateRegressionSolution(IRegressionProblemData problemData) { 57 return new ConstantRegressionSolution(this, problemData);57 return new ConstantRegressionSolution(this, new RegressionProblemData(problemData)); 58 58 } 59 59 } -
branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionEnsembleModel.cs
r7268 r8742 102 102 103 103 public RegressionEnsembleSolution CreateRegressionSolution(IRegressionProblemData problemData) { 104 return new RegressionEnsembleSolution(this.Models, problemData);104 return new RegressionEnsembleSolution(this.Models, new RegressionEnsembleProblemData(problemData)); 105 105 } 106 106 IRegressionSolution IRegressionModel.CreateRegressionSolution(IRegressionProblemData problemData) { -
branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionEnsembleSolution.cs
r8458 r8742 36 36 [Item("Regression Ensemble Solution", "A regression solution that contains an ensemble of multiple regression models")] 37 37 [Creatable("Data Analysis - Ensembles")] 38 public sealed class RegressionEnsembleSolution : RegressionSolution , IRegressionEnsembleSolution {38 public sealed class RegressionEnsembleSolution : RegressionSolutionBase, IRegressionEnsembleSolution { 39 39 private readonly Dictionary<int, double> trainingEvaluationCache = new Dictionary<int, double>(); 40 40 private readonly Dictionary<int, double> testEvaluationCache = new Dictionary<int, double>(); 41 private readonly Dictionary<int, double> evaluationCache = new Dictionary<int, double>(); 41 42 42 43 public new IRegressionEnsembleModel Model { … … 156 157 157 158 #region Evaluation 159 public override IEnumerable<double> EstimatedValues { 160 get { return GetEstimatedValues(Enumerable.Range(0, ProblemData.Dataset.Rows)); } 161 } 162 158 163 public override IEnumerable<double> EstimatedTrainingValues { 159 164 get { -
branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionProblemData.cs
r8430 r8742 121 121 : this(defaultDataset, defaultAllowedInputVariables, defaultTargetVariable) { 122 122 } 123 public RegressionProblemData(IRegressionProblemData regressionProblemData) 124 : this(regressionProblemData.Dataset, regressionProblemData.AllowedInputVariables, regressionProblemData.TargetVariable) { 125 TrainingPartition.Start = regressionProblemData.TrainingPartition.Start; 126 TrainingPartition.End = regressionProblemData.TrainingPartition.End; 127 TestPartition.Start = regressionProblemData.TestPartition.Start; 128 TestPartition.End = regressionProblemData.TestPartition.End; 129 } 123 130 124 131 public RegressionProblemData(Dataset dataset, IEnumerable<string> allowedInputVariables, string targetVariable) -
branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionSolution.cs
r8458 r8742 45 45 : base(model, problemData) { 46 46 evaluationCache = new Dictionary<int, double>(problemData.Dataset.Rows); 47 CalculateRegressionResults(); 47 48 } 49 48 50 49 51 public override IEnumerable<double> EstimatedValues { -
branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionSolutionBase.cs
r8468 r8742 178 178 179 179 protected override void RecalculateResults() { 180 CalculateRe sults();181 } 182 183 pr ivate void CalculateResults() {180 CalculateRegressionResults(); 181 } 182 183 protected void CalculateRegressionResults() { 184 184 IEnumerable<double> estimatedTrainingValues = EstimatedTrainingValues; // cache values 185 185 IEnumerable<double> originalTrainingValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndices);
Note: See TracChangeset
for help on using the changeset viewer.