Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/01/09 11:09:50 (15 years ago)
Author:
gkronber
Message:

Applied patch from mkommend for variable impact calculators and adapted data-modeling algorithms to use the new operators for variable impact calculation. #728

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.LinearRegression/3.2/LinearRegression.cs

    r2290 r2319  
    237237      #endregion
    238238
    239       HeuristicLab.GP.StructureIdentification.VariableEvaluationImpactCalculator evalImpactCalc = new HeuristicLab.GP.StructureIdentification.VariableEvaluationImpactCalculator();
    240       evalImpactCalc.GetVariableInfo("TrainingSamplesStart").ActualName = "ActualTrainingSamplesStart";
    241       evalImpactCalc.GetVariableInfo("TrainingSamplesEnd").ActualName = "ActualTrainingSamplesEnd";
    242       evalImpactCalc.GetVariableInfo("FunctionTree").ActualName = "LinearRegressionModel";
    243       HeuristicLab.Modeling.VariableQualityImpactCalculator qualImpactCalc = new HeuristicLab.GP.StructureIdentification.VariableQualityImpactCalculator();
    244       qualImpactCalc.GetVariableInfo("TrainingSamplesStart").ActualName = "ActualTrainingSamplesStart";
    245       qualImpactCalc.GetVariableInfo("TrainingSamplesEnd").ActualName = "ActualTrainingSamplesEnd";
    246       qualImpactCalc.GetVariableInfo("FunctionTree").ActualName = "LinearRegressionModel";
     239      VariableNamesExtractor namesExtractor = new VariableNamesExtractor();
     240      namesExtractor.GetVariableInfo("FunctionTree").ActualName = "LinearRegressionModel";
     241      namesExtractor.GetVariableInfo("VariableNames").ActualName = "InputVariableNames";
     242      PredictorBuilder predictorBuilder = new PredictorBuilder();
     243      predictorBuilder.GetVariableInfo("FunctionTree").ActualName = "LinearRegressionModel";
     244      VariableEvaluationImpactCalculator evalImpactCalc = new VariableEvaluationImpactCalculator();
     245      evalImpactCalc.GetVariableInfo("SamplesStart").ActualName = "ActualTrainingSamplesStart";
     246      evalImpactCalc.GetVariableInfo("SamplesEnd").ActualName = "ActualTrainingSamplesEnd";
     247      VariableQualityImpactCalculator qualImpactCalc = new VariableQualityImpactCalculator();
     248      qualImpactCalc.GetVariableInfo("SamplesStart").ActualName = "ActualTrainingSamplesStart";
     249      qualImpactCalc.GetVariableInfo("SamplesEnd").ActualName = "ActualTrainingSamplesEnd";
    247250      seqProc.AddSubOperator(trainingMSE);
    248251      seqProc.AddSubOperator(validationMSE);
     
    260263      seqProc.AddSubOperator(validationVAF);
    261264      seqProc.AddSubOperator(testVAF);
     265      seqProc.AddSubOperator(namesExtractor);
     266      seqProc.AddSubOperator(predictorBuilder);
    262267      seqProc.AddSubOperator(qualImpactCalc);
    263268      seqProc.AddSubOperator(evalImpactCalc);
     
    269274
    270275    protected internal virtual IAnalyzerModel CreateLRModel(IScope bestModelScope) {
    271       IGeneticProgrammingModel tree = bestModelScope.GetVariableValue<IGeneticProgrammingModel>("LinearRegressionModel", false);
    272       ITreeEvaluator evaluator = bestModelScope.GetVariableValue<ITreeEvaluator>("TreeEvaluator", true);
    273276      IAnalyzerModel model = new AnalyzerModel();
    274       model.Predictor = new Predictor(evaluator, tree);
     277      model.Predictor = bestModelScope.GetVariableValue<IPredictor>("Predictor", true);
    275278      model.TrainingMeanSquaredError = bestModelScope.GetVariableValue<DoubleData>("TrainingQuality", false).Data;
    276279      model.ValidationMeanSquaredError = bestModelScope.GetVariableValue<DoubleData>("ValidationQuality", false).Data;
Note: See TracChangeset for help on using the changeset viewer.