Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/20/09 11:20:13 (15 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.SupportVectorMachines/3.2/SupportVectorCreator.cs

    r2421 r2440  
    4040      //Dataset infos
    4141      AddVariableInfo(new VariableInfo("Dataset", "Dataset with all samples on which to apply the function", typeof(Dataset), VariableKind.In));
    42       AddVariableInfo(new VariableInfo("TargetVariable", "Index of the column of the dataset that holds the target variable", typeof(IntData), VariableKind.In));
     42      AddVariableInfo(new VariableInfo("TargetVariable", "Name of the target variable", typeof(StringData), VariableKind.In));
    4343      AddVariableInfo(new VariableInfo("InputVariables", "List of allowed input variable names", typeof(ItemList), VariableKind.In));
    4444      AddVariableInfo(new VariableInfo("SamplesStart", "Start index of samples in dataset to evaluate", typeof(IntData), VariableKind.In));
     
    7070      abortRequested = false;
    7171      Dataset dataset = GetVariableValue<Dataset>("Dataset", scope, true);
    72       int targetVariable = GetVariableValue<IntData>("TargetVariable", scope, true).Data;
    73       ItemList inputVaribales = GetVariableValue<ItemList>("InputVariables", scope, true);
    74       var inputVariableNames = from x in inputVaribales
     72      string targetVariable = GetVariableValue<StringData>("TargetVariable", scope, true).Data;
     73      int targetVariableIndex = dataset.GetVariableIndex(targetVariable);
     74      ItemList inputVariables = GetVariableValue<ItemList>("InputVariables", scope, true);
     75      var inputVariableNames = from x in inputVariables
    7576                               select ((StringData)x).Data;
    7677      int start = GetVariableValue<IntData>("SamplesStart", scope, true).Data;
     
    9394      parameter.Probability = false;
    9495
    95       SVM.Problem problem = SVMHelper.CreateSVMProblem(dataset, targetVariable, inputVariableNames, start, end, minTimeOffset, maxTimeOffset);
     96      SVM.Problem problem = SVMHelper.CreateSVMProblem(dataset, targetVariableIndex, inputVariableNames, start, end, minTimeOffset, maxTimeOffset);
    9697      SVM.RangeTransform rangeTransform = SVM.RangeTransform.Compute(problem);
    9798      SVM.Problem scaledProblem = rangeTransform.Scale(problem);
Note: See TracChangeset for help on using the changeset viewer.