Changeset 4543 for trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/SupportVectorRegression
- Timestamp:
- 10/01/10 12:31:04 (14 years ago)
- Location:
- trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/SupportVectorRegression
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/SupportVectorRegression/BestSupportVectorRegressionSolutionAnalyzer.cs
r4068 r4543 68 68 where ProblemData.InputVariables.ItemChecked(var) 69 69 select var.Value; 70 var solution = new SupportVectorRegressionSolution( ProblemData, SupportVectorMachineModel[i], inputVariables, lowerEstimationLimit, upperEstimationLimit);70 var solution = new SupportVectorRegressionSolution((DataAnalysisProblemData)ProblemData.Clone(), SupportVectorMachineModel[i], inputVariables, lowerEstimationLimit, upperEstimationLimit); 71 71 72 72 BestSolutionParameter.ActualValue = solution; -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/SupportVectorRegression/SupportVectorRegressionSolution.cs
r4068 r4543 73 73 74 74 protected override void RecalculateEstimatedValues() { 75 SVM.Problem problem = SupportVectorMachineUtil.CreateSvmProblem(ProblemData, 0, ProblemData.Dataset.Rows);75 SVM.Problem problem = SupportVectorMachineUtil.CreateSvmProblem(ProblemData, Enumerable.Range(0, ProblemData.Dataset.Rows)); 76 76 SVM.Problem scaledProblem = Scaling.Scale(Model.RangeTransform, problem); 77 77 … … 87 87 get { 88 88 if (estimatedValues == null) RecalculateEstimatedValues(); 89 return estimatedValues .AsEnumerable();89 return estimatedValues; 90 90 } 91 91 } … … 93 93 public override IEnumerable<double> EstimatedTrainingValues { 94 94 get { 95 if (estimatedValues == null) RecalculateEstimatedValues(); 96 int start = ProblemData.TrainingSamplesStart.Value; 97 int n = ProblemData.TrainingSamplesEnd.Value - start; 98 return estimatedValues.Skip(start).Take(n).ToList(); 95 return GetEstimatedValues(ProblemData.TrainingIndizes); 99 96 } 100 97 } … … 102 99 public override IEnumerable<double> EstimatedTestValues { 103 100 get { 104 if (estimatedValues == null) RecalculateEstimatedValues(); 105 int start = ProblemData.TestSamplesStart.Value; 106 int n = ProblemData.TestSamplesEnd.Value - start; 107 return estimatedValues.Skip(start).Take(n).ToList(); 101 return GetEstimatedValues(ProblemData.TestIndizes); 108 102 } 103 } 104 105 private IEnumerable<double> GetEstimatedValues(IEnumerable<int> rows) { 106 if (estimatedValues == null) RecalculateEstimatedValues(); 107 foreach (int row in rows) 108 yield return estimatedValues[row]; 109 109 } 110 110 }
Note: See TracChangeset
for help on using the changeset viewer.