Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/29/09 16:07:55 (15 years ago)
Author:
gkronber
Message:

Implemented NodeBasedVariableImpactCalculator. #793

Location:
trunk/sources/HeuristicLab.LinearRegression/3.2
Files:
3 edited

Legend:

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

    r2363 r2454  
    5454    }
    5555
    56     protected override IAnalyzerModel CreateLRModel(IScope bestModelScope) {
    57       var model = new AnalyzerModel();
     56    protected override void CreateSpecificLRModel(IScope bestModelScope, IAnalyzerModel model) {
    5857      DefaultClassificationOperators.PopulateAnalyzerModel(bestModelScope, model);
    59       return model;
    6058    }
    6159  }
  • trunk/sources/HeuristicLab.LinearRegression/3.2/LinearRegression.cs

    r2440 r2454  
    215215      seq.AddSubOperator(namesExtractor);
    216216      seq.AddSubOperator(predictorBuilder);
     217      VariableQualityImpactCalculator qualityImpactCalculator = new VariableQualityImpactCalculator();
     218      qualityImpactCalculator.GetVariableInfo("SamplesStart").ActualName = "TrainingSamplesStart";
     219      qualityImpactCalculator.GetVariableInfo("SamplesEnd").ActualName = "TrainingSamplesEnd";
     220
     221      seq.AddSubOperator(qualityImpactCalculator);
    217222      #endregion
    218223
    219224      seq.AddSubOperator(CreateModelAnalyzerOperator());
     225
     226
     227
    220228
    221229      op.OperatorGraph.AddOperator(seq);
     
    230238    protected virtual IAnalyzerModel CreateLRModel(IScope bestModelScope) {
    231239      var model = new AnalyzerModel();
     240      CreateSpecificLRModel(bestModelScope, model);
     241      #region variable impacts
     242      ItemList qualityImpacts = bestModelScope.GetVariableValue<ItemList>(ModelingResult.VariableQualityImpact.ToString(), false);
     243      foreach (ItemList row in qualityImpacts) {
     244        string variableName = ((StringData)row[0]).Data;
     245        double impact = ((DoubleData)row[1]).Data;
     246        model.SetVariableResult(ModelingResult.VariableQualityImpact, variableName, impact);
     247        model.AddInputVariable(variableName);
     248      }
     249      #endregion
     250      return model;
     251    }
     252
     253    protected virtual void CreateSpecificLRModel(IScope bestModelScope, IAnalyzerModel model) {
    232254      DefaultRegressionOperators.PopulateAnalyzerModel(bestModelScope, model);
    233       return model;
    234255    }
    235256
     
    257278    #region persistence
    258279    public override object Clone(IDictionary<Guid, object> clonedObjects) {
    259       LinearRegression clone = (LinearRegression) base.Clone(clonedObjects);
     280      LinearRegression clone = (LinearRegression)base.Clone(clonedObjects);
    260281      clone.engine = (IEngine)Auxiliary.Clone(Engine, clonedObjects);
    261282      return clone;
  • trunk/sources/HeuristicLab.LinearRegression/3.2/LinearTimeSeriesPrognosis.cs

    r2363 r2454  
    7373    }
    7474
    75     protected override IAnalyzerModel CreateLRModel(IScope bestModelScope) {
    76       var model = new AnalyzerModel();
     75    protected override void CreateSpecificLRModel(IScope bestModelScope, IAnalyzerModel model) {
    7776      DefaultTimeSeriesOperators.PopulateAnalyzerModel(bestModelScope, model);
    78       return model;
    7977    }
    8078  }
Note: See TracChangeset for help on using the changeset viewer.