Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/09/09 14:34:56 (15 years ago)
Author:
gkronber
Message:

Implemented a first version of an operator to calculate variable impacts of models (generated by GP or SVM). #644 (Variable impact of CEDMA models should be calculated and stored in the result DB)

Location:
trunk/sources/HeuristicLab.Modeling/3.2
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Modeling/3.2/HeuristicLab.Modeling-3.2.csproj

    r1906 r2034  
    8383  <ItemGroup>
    8484    <Compile Include="ClassificationProblemInjector.cs" />
     85    <Compile Include="VariableImpactCalculator.cs" />
    8586    <Compile Include="Model.cs" />
    8687    <Compile Include="IModel.cs" />
  • trunk/sources/HeuristicLab.Modeling/3.2/IModel.cs

    r1922 r2034  
    4545    double ValidationVarianceAccountedFor { get; }
    4646    double TestVarianceAccountedFor { get; }
     47    double GetVariableImpact(string variableName);
    4748
    4849    IItem Data { get; }
  • trunk/sources/HeuristicLab.Modeling/3.2/Model.cs

    r1922 r2034  
    120120    }
    121121
     122    public double GetVariableImpact(string variableName) {
     123      if (variableImpacts.ContainsKey(variableName)) return variableImpacts[variableName];
     124      else return 0.0;
     125    }
     126
    122127    private IItem data;
    123128    public IItem Data {
     
    127132
    128133    #endregion
     134
     135    private Dictionary<string, double> variableImpacts = new Dictionary<string, double>();
     136    public void SetVariableImpact(string variableName, double impact) {
     137      variableImpacts[variableName] = impact;
     138    }
     139
     140    public void SetVariableImpact(int variableIndex, double impact) {
     141      variableImpacts[dataset.GetVariableName(variableIndex)] = impact;
     142    }
    129143  }
    130144}
Note: See TracChangeset for help on using the changeset viewer.