Changeset 2161 for trunk/sources/HeuristicLab.GP.StructureIdentification
- Timestamp:
- 07/15/09 16:23:29 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.GP.StructureIdentification/3.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/AlgorithmBase.cs
r2057 r2161 65 65 66 66 public virtual IOperator ProblemInjector { 67 get { return algorithm.SubOperators[ 0]; }67 get { return algorithm.SubOperators[1]; } 68 68 set { 69 69 value.Name = "ProblemInjector"; 70 algorithm.RemoveSubOperator( 0);71 algorithm.AddSubOperator(value, 0);70 algorithm.RemoveSubOperator(1); 71 algorithm.AddSubOperator(value, 1); 72 72 } 73 73 } … … 155 155 MeanSquaredErrorEvaluator evaluator = new MeanSquaredErrorEvaluator(); 156 156 evaluator.GetVariableInfo("MSE").ActualName = "Quality"; 157 evaluator.GetVariableInfo("SamplesStart").ActualName = " TrainingSamplesStart";158 evaluator.GetVariableInfo("SamplesEnd").ActualName = " TrainingSamplesEnd";157 evaluator.GetVariableInfo("SamplesStart").ActualName = "ActualTrainingSamplesStart"; 158 evaluator.GetVariableInfo("SamplesEnd").ActualName = "ActualTrainingSamplesEnd"; 159 159 evaluator.Name = "Evaluator"; 160 160 … … 165 165 LeftReducer cleanUp = new LeftReducer(); 166 166 167 seq.AddSubOperator(randomInjector); 167 168 seq.AddSubOperator(problemInjector); 168 seq.AddSubOperator(randomInjector);169 169 seq.AddSubOperator(globalInjector); 170 170 seq.AddSubOperator(funLibInjector); … … 465 465 // SequentialProcessor in GP 466 466 algorithm = (SequentialProcessor)co1.OperatorGraph.InitialOperator; 467 return (RandomInjector)algorithm.SubOperators[ 1];467 return (RandomInjector)algorithm.SubOperators[0]; 468 468 } 469 469 -
trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/StandardGP.cs
r2130 r2161 96 96 } 97 97 98 public override IOperator ProblemInjector { 99 get { return base.ProblemInjector.SubOperators[0]; } 100 set { 101 value.Name = "ProblemInjector"; 102 base.ProblemInjector.RemoveSubOperator(0); 103 base.ProblemInjector.AddSubOperator(value, 0); 104 } 105 } 106 98 107 public StandardGP() 99 108 : base() { … … 113 122 114 123 protected internal override IOperator CreateProblemInjector() { 115 return new ProblemInjector(); 124 SequentialProcessor seq = new SequentialProcessor(); 125 var probInject = new ProblemInjector(); 126 probInject.GetVariableInfo("MaxNumberOfTrainingSamples").Local = true; 127 probInject.AddVariable(new HeuristicLab.Core.Variable("MaxNumberOfTrainingSamples", new IntData(5000))); 128 129 var shuffler = new DatasetShuffler(); 130 shuffler.GetVariableInfo("ShuffleStart").ActualName = "TrainingSamplesStart"; 131 shuffler.GetVariableInfo("ShuffleEnd").ActualName = "TrainingSamplesEnd"; 132 133 seq.AddSubOperator(probInject); 134 seq.AddSubOperator(shuffler); 135 return seq; 116 136 } 117 137 … … 200 220 protected internal override IOperator CreateBestSolutionProcessor() { 201 221 SequentialProcessor bestSolutionProcessor = new SequentialProcessor(); 222 #region MSE 202 223 MeanSquaredErrorEvaluator testMseEvaluator = new MeanSquaredErrorEvaluator(); 203 224 testMseEvaluator.Name = "TestMeanSquaredErrorEvaluator"; … … 205 226 testMseEvaluator.GetVariableInfo("SamplesStart").ActualName = "TestSamplesStart"; 206 227 testMseEvaluator.GetVariableInfo("SamplesEnd").ActualName = "TestSamplesEnd"; 228 #endregion 229 #region MAPE 207 230 MeanAbsolutePercentageErrorEvaluator trainingMapeEvaluator = new MeanAbsolutePercentageErrorEvaluator(); 208 231 trainingMapeEvaluator.Name = "TrainingMapeEvaluator"; 209 232 trainingMapeEvaluator.GetVariableInfo("MAPE").ActualName = "TrainingMAPE"; 210 trainingMapeEvaluator.GetVariableInfo("SamplesStart").ActualName = " TrainingSamplesStart";211 trainingMapeEvaluator.GetVariableInfo("SamplesEnd").ActualName = " TrainingSamplesEnd";233 trainingMapeEvaluator.GetVariableInfo("SamplesStart").ActualName = "ActualTrainingSamplesStart"; 234 trainingMapeEvaluator.GetVariableInfo("SamplesEnd").ActualName = "ActualTrainingSamplesEnd"; 212 235 MeanAbsolutePercentageErrorEvaluator validationMapeEvaluator = new MeanAbsolutePercentageErrorEvaluator(); 213 236 validationMapeEvaluator.Name = "ValidationMapeEvaluator"; … … 220 243 testMapeEvaluator.GetVariableInfo("SamplesStart").ActualName = "TestSamplesStart"; 221 244 testMapeEvaluator.GetVariableInfo("SamplesEnd").ActualName = "TestSamplesEnd"; 245 #endregion 246 #region MAPRE 222 247 MeanAbsolutePercentageOfRangeErrorEvaluator trainingMapreEvaluator = new MeanAbsolutePercentageOfRangeErrorEvaluator(); 223 248 trainingMapreEvaluator.Name = "TrainingMapreEvaluator"; 224 249 trainingMapreEvaluator.GetVariableInfo("MAPRE").ActualName = "TrainingMAPRE"; 225 trainingMapreEvaluator.GetVariableInfo("SamplesStart").ActualName = " TrainingSamplesStart";226 trainingMapreEvaluator.GetVariableInfo("SamplesEnd").ActualName = " TrainingSamplesEnd";250 trainingMapreEvaluator.GetVariableInfo("SamplesStart").ActualName = "ActualTrainingSamplesStart"; 251 trainingMapreEvaluator.GetVariableInfo("SamplesEnd").ActualName = "ActualTrainingSamplesEnd"; 227 252 MeanAbsolutePercentageOfRangeErrorEvaluator validationMapreEvaluator = new MeanAbsolutePercentageOfRangeErrorEvaluator(); 228 253 validationMapreEvaluator.Name = "ValidationMapreEvaluator"; … … 235 260 testMapreEvaluator.GetVariableInfo("SamplesStart").ActualName = "TestSamplesStart"; 236 261 testMapreEvaluator.GetVariableInfo("SamplesEnd").ActualName = "TestSamplesEnd"; 262 #endregion MAPRE 263 #region R2 237 264 CoefficientOfDeterminationEvaluator trainingR2Evaluator = new CoefficientOfDeterminationEvaluator(); 238 265 trainingR2Evaluator.Name = "TrainingR2Evaluator"; 239 266 trainingR2Evaluator.GetVariableInfo("R2").ActualName = "TrainingR2"; 240 trainingR2Evaluator.GetVariableInfo("SamplesStart").ActualName = " TrainingSamplesStart";241 trainingR2Evaluator.GetVariableInfo("SamplesEnd").ActualName = " TrainingSamplesEnd";267 trainingR2Evaluator.GetVariableInfo("SamplesStart").ActualName = "ActualTrainingSamplesStart"; 268 trainingR2Evaluator.GetVariableInfo("SamplesEnd").ActualName = "ActualTrainingSamplesEnd"; 242 269 CoefficientOfDeterminationEvaluator validationR2Evaluator = new CoefficientOfDeterminationEvaluator(); 243 270 validationR2Evaluator.Name = "ValidationR2Evaluator"; … … 250 277 testR2Evaluator.GetVariableInfo("SamplesStart").ActualName = "TestSamplesStart"; 251 278 testR2Evaluator.GetVariableInfo("SamplesEnd").ActualName = "TestSamplesEnd"; 279 #endregion 280 #region VAF 252 281 VarianceAccountedForEvaluator trainingVAFEvaluator = new VarianceAccountedForEvaluator(); 253 282 trainingVAFEvaluator.Name = "TrainingVAFEvaluator"; 254 283 trainingVAFEvaluator.GetVariableInfo("VAF").ActualName = "TrainingVAF"; 255 trainingVAFEvaluator.GetVariableInfo("SamplesStart").ActualName = " TrainingSamplesStart";256 trainingVAFEvaluator.GetVariableInfo("SamplesEnd").ActualName = " TrainingSamplesEnd";284 trainingVAFEvaluator.GetVariableInfo("SamplesStart").ActualName = "ActualTrainingSamplesStart"; 285 trainingVAFEvaluator.GetVariableInfo("SamplesEnd").ActualName = "ActualTrainingSamplesEnd"; 257 286 VarianceAccountedForEvaluator validationVAFEvaluator = new VarianceAccountedForEvaluator(); 258 287 validationVAFEvaluator.Name = "ValidationVAFEvaluator"; … … 265 294 testVAFEvaluator.GetVariableInfo("SamplesStart").ActualName = "TestSamplesStart"; 266 295 testVAFEvaluator.GetVariableInfo("SamplesEnd").ActualName = "TestSamplesEnd"; 267 296 #endregion 268 297 ProgrammableOperator progOperator = new ProgrammableOperator(); 269 298 progOperator.RemoveVariableInfo("Result");
Note: See TracChangeset
for help on using the changeset viewer.