Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/05/12 10:50:54 (12 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/Regression
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/RegressionInstanceProvider.cs

    r7860 r7965  
    3636
    3737      Dataset dataset = new Dataset(csvFileParser.VariableNames, csvFileParser.Values);
    38       string targetVar = csvFileParser.VariableNames.Last();
     38      string targetVar = csvFileParser.VariableNames.Where(x => dataset.DoubleVariables.Contains(x)).Last();
    3939
    40       IEnumerable<string> allowedInputVars = csvFileParser.VariableNames.Where(x => !x.Equals(targetVar));
     40      IEnumerable<string> allowedInputVars = dataset.DoubleVariables.Where(x => !x.Equals(targetVar));
    4141
    4242      IRegressionProblemData regData = new RegressionProblemData(dataset, allowedInputVars, targetVar);
  • trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/ResourceRegressionInstanceProvider.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        IRegressionProblemData regData = new RegressionProblemData(dataset, allowedInputVars, targetVar);
Note: See TracChangeset for help on using the changeset viewer.