Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/20/09 11:20:13 (14 years ago)
Author:
gkronber
Message:

Fixed #784 (ProblemInjector should be changed to read variable names instead of indexes for input and target variables)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/MulticlassOneVsOneAnalyzer.cs

    r2328 r2440  
    5252      : base() {
    5353      AddVariableInfo(new VariableInfo(DATASET, "The dataset to use", typeof(Dataset), VariableKind.In));
    54       AddVariableInfo(new VariableInfo(TARGETVARIABLE, "Target variable", typeof(IntData), VariableKind.In));
     54      AddVariableInfo(new VariableInfo(TARGETVARIABLE, "Target variable", typeof(StringData), VariableKind.In));
    5555      AddVariableInfo(new VariableInfo(TARGETCLASSVALUES, "Class values of the target variable in the original dataset", typeof(ItemList<DoubleData>), VariableKind.In));
    5656      AddVariableInfo(new VariableInfo(CLASSAVALUE, "The original class value of the class A in the subscope", typeof(DoubleData), VariableKind.In));
     
    6767    public override IOperation Apply(IScope scope) {
    6868      Dataset dataset = GetVariableValue<Dataset>(DATASET, scope, true);
    69       int targetVariable = GetVariableValue<IntData>(TARGETVARIABLE, scope, true).Data;
     69      string targetVariable = GetVariableValue<StringData>(TARGETVARIABLE, scope, true).Data;
     70      int targetVariableIndex = dataset.GetVariableIndex(targetVariable);
    7071      int trainingSamplesStart = GetVariableValue<IntData>(TRAININGSAMPLESSTART, scope, true).Data;
    7172      int trainingSamplesEnd = GetVariableValue<IntData>(TRAININGSAMPLESEND, scope, true).Data;
     
    9596      int correctlyClassified = 0;
    9697      for(int i = 0; i < (samplesEnd - samplesStart); i++) {
    97         double originalClassValue = dataset.GetValue(i + samplesStart, targetVariable);
     98        double originalClassValue = dataset.GetValue(i + samplesStart, targetVariableIndex);
    9899        double estimatedClassValue = classValues[0].Data;
    99100        int maxVotes = votes[i, 0];
Note: See TracChangeset for help on using the changeset viewer.