Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/20/11 11:45:18 (12 years ago)
Author:
gkronber
Message:

#1081 merged r7103:7209 from trunk into time series branch

Location:
branches/HeuristicLab.TimeSeries
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.TimeSeries

  • branches/HeuristicLab.TimeSeries/HeuristicLab.Algorithms.DataAnalysis/3.4/CrossValidation.cs

    r6636 r7213  
    224224      }
    225225    }
     226    public static new Image StaticItemImage {
     227      get { return HeuristicLab.Common.Resources.VSImageLibrary.Event; }
     228    }
    226229    public override Image ItemImage {
    227230      get {
     
    230233        else if (ExecutionState == ExecutionState.Paused) return HeuristicLab.Common.Resources.VSImageLibrary.ExecutablePaused;
    231234        else if (ExecutionState == ExecutionState.Stopped) return HeuristicLab.Common.Resources.VSImageLibrary.ExecutableStopped;
    232         else return HeuristicLab.Common.Resources.VSImageLibrary.Event;
     235        else return base.ItemImage;
    233236      }
    234237    }
     
    278281            int testEnd = (i + 1) == Folds.Value ? SamplesEnd.Value : (i + 1) * testSamplesCount + SamplesStart.Value;
    279282
     283            problem.ProblemData.TrainingPartition.Start = SamplesStart.Value;
     284            problem.ProblemData.TrainingPartition.End = SamplesEnd.Value;
    280285            problem.ProblemData.TestPartition.Start = testStart;
    281286            problem.ProblemData.TestPartition.End = testEnd;
     
    515520        throw new InvalidOperationException("Can not change number of folds if the execution state is not prepared.");
    516521    }
     522
     523    private bool samplesChanged = false;
    517524    private void SamplesStart_ValueChanged(object sender, EventArgs e) {
     525      samplesChanged = true;
    518526      if (Problem != null) Problem.ProblemData.TrainingPartition.Start = SamplesStart.Value;
     527      samplesChanged = false;
    519528    }
    520529    private void SamplesEnd_ValueChanged(object sender, EventArgs e) {
     530      samplesChanged = true;
    521531      if (Problem != null) Problem.ProblemData.TrainingPartition.End = SamplesEnd.Value;
     532      samplesChanged = false;
    522533    }
    523534
     
    543554        throw new ArgumentException("A cross validation algorithm can only contain DataAnalysisProblems.");
    544555      }
    545       algorithm.Problem.Reset += (x,y) => OnProblemChanged();
     556      algorithm.Problem.Reset += (x, y) => OnProblemChanged();
    546557      problem = (IDataAnalysisProblem)algorithm.Problem;
    547558      OnProblemChanged();
     
    551562      EventHandler handler = ProblemChanged;
    552563      if (handler != null) handler(this, EventArgs.Empty);
     564      if (samplesChanged) return;
    553565
    554566      SamplesStart.Value = 0;
Note: See TracChangeset for help on using the changeset viewer.