- Timestamp:
- 09/01/09 11:09:50 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/BaseClasses/AlgorithmBase.cs
r2290 r2319 311 311 312 312 protected internal virtual IOperator CreateBestSolutionProcessor() { 313 return new EmptyOperator(); 313 SequentialProcessor seq = new SequentialProcessor(); 314 // calculate and set variable impacts 315 VariableNamesExtractor namesExtractor = new VariableNamesExtractor(); 316 namesExtractor.GetVariableInfo("VariableNames").ActualName = "InputVariableNames"; 317 PredictorBuilder predictorBuilder = new PredictorBuilder(); 318 319 VariableEvaluationImpactCalculator evaluationImpactCalculator = new VariableEvaluationImpactCalculator(); 320 evaluationImpactCalculator.GetVariableInfo("SamplesStart").ActualName = "ActualTrainingSamplesStart"; 321 evaluationImpactCalculator.GetVariableInfo("SamplesEnd").ActualName = "ActualTrainingSamplesEnd"; 322 VariableQualityImpactCalculator qualityImpactCalculator = new VariableQualityImpactCalculator(); 323 qualityImpactCalculator.GetVariableInfo("SamplesStart").ActualName = "ActualTrainingSamplesStart"; 324 qualityImpactCalculator.GetVariableInfo("SamplesEnd").ActualName = "ActualTrainingSamplesEnd"; 325 326 seq.AddSubOperator(namesExtractor); 327 seq.AddSubOperator(predictorBuilder); 328 seq.AddSubOperator(evaluationImpactCalculator); 329 seq.AddSubOperator(qualityImpactCalculator); 330 return seq; 314 331 } 315 332 … … 410 427 411 428 protected internal virtual IAnalyzerModel CreateGPModel(IScope bestModelScope) { 412 Engine.GlobalScope.AddSubScope(bestModelScope);413 IGeneticProgrammingModel tree = bestModelScope.GetVariableValue<IGeneticProgrammingModel>("FunctionTree", false);414 ITreeEvaluator evaluator = bestModelScope.GetVariableValue<ITreeEvaluator>("TreeEvaluator", true);415 429 IAnalyzerModel model = new AnalyzerModel(); 416 model.Predictor = new Predictor(evaluator, tree);430 model.Predictor = bestModelScope.GetVariableValue<IPredictor>("Predictor", true); 417 431 Dataset ds = bestModelScope.GetVariableValue<Dataset>("Dataset", true); 418 432 model.Dataset = ds; … … 427 441 model.TrainingMeanSquaredError = bestModelScope.GetVariableValue<DoubleData>("Quality", false).Data; 428 442 model.ValidationMeanSquaredError = bestModelScope.GetVariableValue<DoubleData>("ValidationQuality", false).Data; 429 // calculate and set variable impacts430 VariableEvaluationImpactCalculator evaluationImpactCalculator = new VariableEvaluationImpactCalculator();431 evaluationImpactCalculator.GetVariableInfo("TrainingSamplesStart").ActualName = "ActualTrainingSamplesStart";432 evaluationImpactCalculator.GetVariableInfo("TrainingSamplesEnd").ActualName = "ActualTrainingSamplesEnd";433 VariableQualityImpactCalculator qualityImpactCalculator = new VariableQualityImpactCalculator();434 qualityImpactCalculator.GetVariableInfo("TrainingSamplesStart").ActualName = "ActualTrainingSamplesStart";435 qualityImpactCalculator.GetVariableInfo("TrainingSamplesEnd").ActualName = "ActualTrainingSamplesEnd";436 437 438 evaluationImpactCalculator.Apply(bestModelScope);439 qualityImpactCalculator.Apply(bestModelScope);440 443 441 444 ItemList evaluationImpacts = bestModelScope.GetVariableValue<ItemList>("VariableEvaluationImpacts", false);
Note: See TracChangeset
for help on using the changeset viewer.