Changeset 5275 for branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/ParameterAdjustmentProblem
- Timestamp:
- 01/11/11 15:03:46 (14 years ago)
- Location:
- branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/ParameterAdjustmentProblem
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/ParameterAdjustmentProblem/SupportVectorMachineParameterAdjustmentBestSolutionAnalyzer.cs
r4068 r5275 30 30 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 31 31 using HeuristicLab.Problems.DataAnalysis.Evaluators; 32 using HeuristicLab.Common; 32 33 33 34 namespace HeuristicLab.Problems.DataAnalysis.SupportVectorMachine.ParameterAdjustmentProblem { … … 89 90 90 91 #endregion 91 92 [StorableConstructor] 93 protected SupportVectorMachineParameterAdjustmentBestSolutionAnalyzer(bool deserializing) : base(deserializing) { } 94 protected SupportVectorMachineParameterAdjustmentBestSolutionAnalyzer(SupportVectorMachineParameterAdjustmentBestSolutionAnalyzer original, Cloner cloner) 95 : base(original, cloner) { 96 } 92 97 public SupportVectorMachineParameterAdjustmentBestSolutionAnalyzer() 93 98 : base() { … … 103 108 Parameters.Add(new LookupParameter<ResultCollection>(ResultsParameterName, "The result collection where the best support vector solution should be stored.")); 104 109 } 105 110 public override IDeepCloneable Clone(Cloner cloner) { 111 return new SupportVectorMachineParameterAdjustmentBestSolutionAnalyzer(this, cloner); 112 } 106 113 public override IOperation Apply() { 107 114 var points = ParameterVectorParameter.ActualValue; … … 124 131 if (bestModel == null) { 125 132 bestModel = SupportVectorMachineModelCreator.TrainModel(DataAnalysisProblemData, 126 DataAnalysisProblemData.Training SamplesStart.Value, DataAnalysisProblemData.TrainingSamplesEnd.Value,133 DataAnalysisProblemData.TrainingIndizes, 127 134 SvmType.Value, KernelType.Value, cost, nu, gamma, 0.0); 128 135 BestSolutionParameter.ActualValue = bestModel; … … 153 160 if (BestSolutionQualityParameter.ActualValue.Value > bestQuality) { 154 161 bestModel = SupportVectorMachineModelCreator.TrainModel(DataAnalysisProblemData, 155 DataAnalysisProblemData.Training SamplesStart.Value, DataAnalysisProblemData.TrainingSamplesEnd.Value,162 DataAnalysisProblemData.TrainingIndizes, 156 163 SvmType.Value, KernelType.Value, cost, nu, gamma, 0.0); 157 164 BestSolutionParameter.ActualValue = bestModel; -
branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/ParameterAdjustmentProblem/SupportVectorMachineParameterAdjustmentEvaluator.cs
r4068 r5275 28 28 using HeuristicLab.Parameters; 29 29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 30 using HeuristicLab.Common; 30 31 31 32 namespace HeuristicLab.Problems.DataAnalysis.SupportVectorMachine.ParameterAdjustmentProblem { … … 107 108 } 108 109 #endregion 109 110 [StorableConstructor] 111 protected SupportVectorMachineParameterAdjustmentEvaluator(bool deserializing) : base(deserializing) { } 112 protected SupportVectorMachineParameterAdjustmentEvaluator(SupportVectorMachineParameterAdjustmentEvaluator original, Cloner cloner) 113 : base(original, cloner) { 114 } 110 115 public SupportVectorMachineParameterAdjustmentEvaluator() 111 116 : base() { … … 130 135 evaluator.Successor = null; 131 136 } 137 public override IDeepCloneable Clone(Cloner cloner) { 138 return new SupportVectorMachineParameterAdjustmentEvaluator(this, cloner); 139 } 132 140 133 141 public override IOperation Apply() { -
branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/ParameterAdjustmentProblem/SupportVectorMachineParameterAdjustmentProblem.cs
r4118 r5275 130 130 [StorableConstructor] 131 131 private SupportVectorMachineParameterAdjustmentProblem(bool deserializing) : base(deserializing) { } 132 private SupportVectorMachineParameterAdjustmentProblem(SupportVectorMachineParameterAdjustmentProblem original, Cloner cloner) 133 : base(original, cloner) { 134 operators = original.operators.Where(x => IsNotFieldReferenced(x)).Select(x => (IOperator)cloner.Clone(x)).ToList(); 135 strategyVectorCreator = (StdDevStrategyVectorCreator)cloner.Clone(original.strategyVectorCreator); 136 operators.Add(strategyVectorCreator); 137 strategyVectorCrossover = (StdDevStrategyVectorCrossover)cloner.Clone(original.strategyVectorCrossover); 138 operators.Add(strategyVectorCrossover); 139 strategyVectorManipulator = (StdDevStrategyVectorManipulator)cloner.Clone(original.strategyVectorManipulator); 140 operators.Add(strategyVectorManipulator); 141 AttachEventHandlers(); 142 } 132 143 public SupportVectorMachineParameterAdjustmentProblem() 133 144 : base() { … … 167 178 168 179 public override IDeepCloneable Clone(Cloner cloner) { 169 SupportVectorMachineParameterAdjustmentProblem clone = (SupportVectorMachineParameterAdjustmentProblem)base.Clone(cloner); 170 clone.operators = operators.Where(x => IsNotFieldReferenced(x)).Select(x => (IOperator)cloner.Clone(x)).ToList(); 171 clone.strategyVectorCreator = (StdDevStrategyVectorCreator)cloner.Clone(strategyVectorCreator); 172 clone.operators.Add(clone.strategyVectorCreator); 173 clone.strategyVectorCrossover = (StdDevStrategyVectorCrossover)cloner.Clone(strategyVectorCrossover); 174 clone.operators.Add(strategyVectorCrossover); 175 clone.strategyVectorManipulator = (StdDevStrategyVectorManipulator)cloner.Clone(strategyVectorManipulator); 176 clone.operators.Add(strategyVectorManipulator); 177 clone.AttachEventHandlers(); 178 return clone; 179 } 180 180 return new SupportVectorMachineParameterAdjustmentProblem(this, cloner); 181 } 181 182 private bool IsNotFieldReferenced(IOperator x) { 182 183 return !(x == strategyVectorCreator
Note: See TracChangeset
for help on using the changeset viewer.