Changeset 7265


Ignore:
Timestamp:
01/03/12 10:27:33 (8 years ago)
Author:
gkronber
Message:

#1729 added a statement to make sure the number of training and test indexes that should be returned is never negative.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/DataAnalysisProblemData.cs

    r7259 r7265  
    7777    public virtual IEnumerable<int> TrainingIndizes {
    7878      get {
    79         return Enumerable.Range(TrainingPartition.Start, TrainingPartition.End - TrainingPartition.Start)
     79        return Enumerable.Range(TrainingPartition.Start, Math.Max(0, TrainingPartition.End - TrainingPartition.Start))
    8080                         .Where(IsTrainingSample);
    8181      }
     
    8383    public virtual IEnumerable<int> TestIndizes {
    8484      get {
    85         return Enumerable.Range(TestPartition.Start, TestPartition.End - TestPartition.Start)
     85        return Enumerable.Range(TestPartition.Start, Math.Max(0, TestPartition.End - TestPartition.Start))
    8686           .Where(IsTestSample);
    8787      }
Note: See TracChangeset for help on using the changeset viewer.