Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/18/13 13:15:29 (11 years ago)
Author:
pfleck
Message:

Fixed bug with partition range.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/PreprocessingData.cs

    r10221 r10235  
    3636
    3737    private IList<string> variableNames;
    38     private IntRange trainingPartition;
    39     private IntRange testPartition;
    4038
    4139    private IDictionary<string, int> variableNameIndices;
     
    7573      }
    7674
    77       trainingPartition = problemData.TrainingPartition;
    78       testPartition = problemData.TestPartition;
    79 
    80       trainingToTestRatio = (double)problemData.TrainingPartition.Size / problemData.TestPartition.Size;
     75      trainingToTestRatio = (double)problemData.TrainingPartition.Size / Math.Max(problemData.Dataset.Rows, double.Epsilon);
    8176    }
    8277
     
    147142
    148143    public IntRange TestPartition {
    149       get { return new IntRange((int)(Rows * trainingToTestRatio), Math.Max(Rows - 1, 0)); }
     144      get { return new IntRange((int)(Rows * trainingToTestRatio), Rows); }
    150145    }
    151146
Note: See TracChangeset for help on using the changeset viewer.