Changeset 4678 for branches/CloningRefactoring/HeuristicLab.Problems.DataAnalysis.Regression/3.3/SupportVectorRegression
- Timestamp:
- 10/29/10 19:26:56 (14 years ago)
- Location:
- branches/CloningRefactoring/HeuristicLab.Problems.DataAnalysis.Regression/3.3/SupportVectorRegression
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/CloningRefactoring/HeuristicLab.Problems.DataAnalysis.Regression/3.3/SupportVectorRegression/BestSupportVectorRegressionSolutionAnalyzer.cs
r4543 r4678 22 22 using System.Collections.Generic; 23 23 using System.Linq; 24 using HeuristicLab.Common; 24 25 using HeuristicLab.Core; 25 26 using HeuristicLab.Data; … … 52 53 #endregion 53 54 55 [StorableConstructor] 56 private BestSupportVectorRegressionSolutionAnalyzer(bool deserializing) : base(deserializing) { } 57 private BestSupportVectorRegressionSolutionAnalyzer(BestSupportVectorRegressionSolutionAnalyzer original, Cloner cloner) : base(original, cloner) { } 54 58 public BestSupportVectorRegressionSolutionAnalyzer() 55 59 : base() { 56 60 Parameters.Add(new ScopeTreeLookupParameter<SupportVectorMachineModel>(SupportVectorRegressionModelParameterName, "The support vector regression models to analyze.")); 57 61 Parameters.Add(new LookupParameter<SupportVectorRegressionSolution>(BestSolutionParameterName, "The best support vector regression solution.")); 62 } 63 64 public override IDeepCloneable Clone(Cloner cloner) { 65 return new BestSupportVectorRegressionSolutionAnalyzer(this, cloner); 58 66 } 59 67 -
branches/CloningRefactoring/HeuristicLab.Problems.DataAnalysis.Regression/3.3/SupportVectorRegression/SupportVectorRegressionSolution.cs
r4543 r4678 24 24 using System.Drawing; 25 25 using System.Linq; 26 using HeuristicLab.Common; 26 27 using HeuristicLab.Core; 27 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 36 37 [StorableClass] 37 38 public sealed class SupportVectorRegressionSolution : DataAnalysisSolution { 38 public SupportVectorRegressionSolution() : base() { }39 public SupportVectorRegressionSolution(DataAnalysisProblemData problemData, SupportVectorMachineModel model, IEnumerable<string> inputVariables, double lowerEstimationLimit, double upperEstimationLimit)40 : base(problemData, lowerEstimationLimit, upperEstimationLimit) {41 this.Model = model;42 }43 44 39 public override Image ItemImage { 45 40 get { return HeuristicLab.Common.Resources.VS2008ImageLibrary.Function; } … … 53 48 public Dataset SupportVectors { 54 49 get { return CalculateSupportVectors(); } 50 } 51 52 private List<double> estimatedValues; 53 public override IEnumerable<double> EstimatedValues { 54 get { 55 if (estimatedValues == null) RecalculateEstimatedValues(); 56 return estimatedValues; 57 } 58 } 59 60 public override IEnumerable<double> EstimatedTrainingValues { 61 get { 62 return GetEstimatedValues(ProblemData.TrainingIndizes); 63 } 64 } 65 66 public override IEnumerable<double> EstimatedTestValues { 67 get { 68 return GetEstimatedValues(ProblemData.TestIndizes); 69 } 70 } 71 72 [StorableConstructor] 73 private SupportVectorRegressionSolution(bool deserializing) : base(deserializing) { } 74 private SupportVectorRegressionSolution(SupportVectorRegressionSolution original, Cloner cloner) : base(original, cloner) { } 75 public SupportVectorRegressionSolution() : base() { } 76 public SupportVectorRegressionSolution(DataAnalysisProblemData problemData, SupportVectorMachineModel model, IEnumerable<string> inputVariables, double lowerEstimationLimit, double upperEstimationLimit) 77 : base(problemData, lowerEstimationLimit, upperEstimationLimit) { 78 this.Model = model; 79 } 80 81 public override IDeepCloneable Clone(Cloner cloner) { 82 return new SupportVectorRegressionSolution(this, cloner); 55 83 } 56 84 … … 83 111 } 84 112 85 private List<double> estimatedValues;86 public override IEnumerable<double> EstimatedValues {87 get {88 if (estimatedValues == null) RecalculateEstimatedValues();89 return estimatedValues;90 }91 }92 93 public override IEnumerable<double> EstimatedTrainingValues {94 get {95 return GetEstimatedValues(ProblemData.TrainingIndizes);96 }97 }98 99 public override IEnumerable<double> EstimatedTestValues {100 get {101 return GetEstimatedValues(ProblemData.TestIndizes);102 }103 }104 113 105 114 private IEnumerable<double> GetEstimatedValues(IEnumerable<int> rows) {
Note: See TracChangeset
for help on using the changeset viewer.