Free cookie consent management tool by TermsFeed Policy Generator

Changeset 11540


Ignore:
Timestamp:
11/12/14 14:16:38 (10 years ago)
Author:
mkommend
Message:

#2273: Changed behavior of CSV import for clustering problem data to enable all input variables per default.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Clustering/CSV/ClusteringCSVInstanceProvider.cs

    r11283 r11540  
    6161
    6262      Dataset dataset = new Dataset(csvFileParser.VariableNames, csvFileParser.Values);
    63       string targetVar = dataset.DoubleVariables.Last();
    6463
    6564      // turn of input variables that are constant in the training partition
     
    6867      if (trainingIndizes.Count() >= 2) {
    6968        foreach (var variableName in dataset.DoubleVariables) {
    70           if (dataset.GetDoubleValues(variableName, trainingIndizes).Range() > 0 &&
    71             variableName != targetVar)
     69          if (dataset.GetDoubleValues(variableName, trainingIndizes).Range() > 0)
    7270            allowedInputVars.Add(variableName);
    7371        }
    7472      } else {
    75         allowedInputVars.AddRange(dataset.DoubleVariables.Where(x => !x.Equals(targetVar)));
     73        allowedInputVars.AddRange(dataset.DoubleVariables);
    7674      }
    7775
     
    9694
    9795      Dataset dataset = new Dataset(csvFileParser.VariableNames, values);
    98       string targetVar = dataset.DoubleVariables.Last();
    9996
    10097      // turn of input variables that are constant in the training partition
     
    104101      if (trainingIndizes.Count() >= 2) {
    105102        foreach (var variableName in dataset.DoubleVariables) {
    106           if (dataset.GetDoubleValues(variableName, trainingIndizes).Range() > 0 &&
    107             variableName != targetVar)
     103          if (dataset.GetDoubleValues(variableName, trainingIndizes).Range() > 0)
    108104            allowedInputVars.Add(variableName);
    109105        }
    110106      } else {
    111         allowedInputVars.AddRange(dataset.DoubleVariables.Where(x => !x.Equals(targetVar)));
     107        allowedInputVars.AddRange(dataset.DoubleVariables);
    112108      }
    113109
Note: See TracChangeset for help on using the changeset viewer.