Free cookie consent management tool by TermsFeed Policy Generator

Changeset 5279


Ignore:
Timestamp:
01/11/11 17:03:33 (14 years ago)
Author:
mkommend
Message:

Corrected validation range in ClassificationProblem (ticket #1373).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Classification/3.3/Symbolic/SymbolicClassificationProblem.cs

    r5273 r5279  
    123123      get { return new DoubleValue(10.0); }
    124124    }
    125     public IntValue TrainingSamplesStart { get { return new IntValue(ClassificationProblemData.TrainingSamplesStart.Value); } }
     125    public IntValue TrainingSamplesStart { get { return new IntValue(ClassificationProblemData.TrainingIndizes.First()); } }
    126126    public IntValue TrainingSamplesEnd {
    127       get { return new IntValue((ClassificationProblemData.TrainingSamplesStart.Value + ClassificationProblemData.TrainingSamplesEnd.Value) / 2); }
     127      get {
     128        int endIndex = (int)(ClassificationProblemData.TrainingIndizes.Count() * (1.0 - ClassificationProblemData.ValidationPercentage.Value) - 1);
     129        if (endIndex < 0) endIndex = 0;
     130        return new IntValue(ClassificationProblemData.TrainingIndizes.ElementAt(endIndex));
     131      }
    128132    }
    129133    public IntValue ValidationSamplesStart { get { return TrainingSamplesEnd; } }
    130     public IntValue ValidationSamplesEnd { get { return new IntValue(ClassificationProblemData.TrainingSamplesEnd.Value); } }
     134    public IntValue ValidationSamplesEnd { get { return new IntValue(ClassificationProblemData.TrainingIndizes.Last() + 1); } }
    131135    public IntValue TestSamplesStart { get { return ClassificationProblemData.TestSamplesStart; } }
    132136    public IntValue TestSamplesEnd { get { return ClassificationProblemData.TestSamplesEnd; } }
Note: See TracChangeset for help on using the changeset viewer.