Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/05/12 10:50:54 (13 years ago)
Author:
sforsten
Message:

#1784: CSV files that contain columns with non-numeric data can be imported again.

Location:
trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Classification
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Classification/ClassificationInstanceProvider.cs

    r7851 r7965  
    3636
    3737      Dataset dataset = new Dataset(csvFileParser.VariableNames, csvFileParser.Values);
    38       string targetVar = csvFileParser.VariableNames.Last();
    39       IEnumerable<string> allowedInputVars = csvFileParser.VariableNames.Where(x => !x.Equals(targetVar));
     38      string targetVar = csvFileParser.VariableNames.Where(x => dataset.DoubleVariables.Contains(x)).Last();
     39      IEnumerable<string> allowedInputVars = dataset.DoubleVariables.Where(x => !x.Equals(targetVar));
    4040
    4141      ClassificationProblemData claData = new ClassificationProblemData(dataset, allowedInputVars, targetVar);
  • trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Classification/ResourceClassificationInstanceProvider.cs

    r7851 r7965  
    7070
    7171        Dataset dataset = new Dataset(csvFileParser.VariableNames, csvFileParser.Values);
    72         string targetVar = csvFileParser.VariableNames.Last();
    73         IEnumerable<string> allowedInputVars = csvFileParser.VariableNames.Where(x => !x.Equals(targetVar));
     72        string targetVar = csvFileParser.VariableNames.Where(x => dataset.DoubleVariables.Contains(x)).Last();
     73        IEnumerable<string> allowedInputVars = dataset.DoubleVariables.Where(x => !x.Equals(targetVar));
    7474
    7575        ClassificationProblemData claData = new ClassificationProblemData(dataset, allowedInputVars, targetVar);
Note: See TracChangeset for help on using the changeset viewer.