Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/22/10 17:36:51 (14 years ago)
Author:
mkommend
Message:

Added validation logic for training and test samples in DataAnalysisProblemData (ticket #1199).

File:
1 edited

Legend:

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

    r4468 r4473  
    248248    public event EventHandler ProblemDataChanged;
    249249    protected virtual void OnProblemDataChanged(EventArgs e) {
    250       if (!suppressEvents) {
     250      if (TrainingSamplesStart.Value < 0) TrainingSamplesStart.Value = 0;
     251      else if (TestSamplesStart.Value < 0) TestSamplesStart.Value = 0;
     252      else if (TrainingSamplesEnd.Value > Dataset.Rows - 1) TrainingSamplesEnd.Value = Dataset.Rows - 1;
     253      else if (TestSamplesEnd.Value > Dataset.Rows - 1) TestSamplesEnd.Value = Dataset.Rows - 1;
     254      else if (TrainingSamplesStart.Value > TrainingSamplesEnd.Value) TrainingSamplesStart.Value = TestSamplesEnd.Value;
     255      else if (TestSamplesStart.Value > TestSamplesEnd.Value) TestSamplesStart.Value = TestSamplesEnd.Value;
     256      else if (ValidationPercentage.Value < 0) ValidationPercentage.Value = 0;
     257      else if (ValidationPercentage.Value > 1) ValidationPercentage.Value = 1;
     258      else if (!TrainingIndizes.Any()) throw new ArgumentException("No training samples are available.");
     259      else if (!suppressEvents) {
    251260        var listeners = ProblemDataChanged;
    252261        if (listeners != null) listeners(this, e);
Note: See TracChangeset for help on using the changeset viewer.