Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/07/12 16:30:40 (12 years ago)
Author:
sforsten
Message:

#1942: training has now at least one sample

File:
1 edited

Legend:

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

    r8599 r8601  
    100100      var allowedInputVars = new List<string>();
    101101      int trainingPartEnd = (csvFileParser.Rows * type.Training) / 100;
     102      trainingPartEnd = trainingPartEnd > 0 ? trainingPartEnd : 1;
    102103      var trainingIndizes = Enumerable.Range(0, trainingPartEnd);
    103       foreach (var variableName in dataset.DoubleVariables) {
    104         if (trainingIndizes.Count() >= 2 && dataset.GetDoubleValues(variableName, trainingIndizes).Range() > 0 &&
    105           variableName != targetVar)
    106           allowedInputVars.Add(variableName);
     104      if (trainingIndizes.Count() >= 2) {
     105        foreach (var variableName in dataset.DoubleVariables) {
     106          if (dataset.GetDoubleValues(variableName, trainingIndizes).Range() > 0 &&
     107            variableName != targetVar)
     108            allowedInputVars.Add(variableName);
     109        }
     110      } else {
     111        allowedInputVars.AddRange(dataset.DoubleVariables.Where(x => x.Equals(targetVar)));
    107112      }
    108113
Note: See TracChangeset for help on using the changeset viewer.