Changeset 7107
- Timestamp:
- 12/01/11 13:49:59 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/CrossValidation.cs
r6636 r7107 278 278 int testEnd = (i + 1) == Folds.Value ? SamplesEnd.Value : (i + 1) * testSamplesCount + SamplesStart.Value; 279 279 280 problem.ProblemData.TrainingPartition.Start = SamplesStart.Value; 281 problem.ProblemData.TrainingPartition.End = SamplesEnd.Value; 280 282 problem.ProblemData.TestPartition.Start = testStart; 281 283 problem.ProblemData.TestPartition.End = testEnd; … … 515 517 throw new InvalidOperationException("Can not change number of folds if the execution state is not prepared."); 516 518 } 519 520 private bool samplesChanged = false; 517 521 private void SamplesStart_ValueChanged(object sender, EventArgs e) { 522 samplesChanged = true; 518 523 if (Problem != null) Problem.ProblemData.TrainingPartition.Start = SamplesStart.Value; 524 samplesChanged = false; 519 525 } 520 526 private void SamplesEnd_ValueChanged(object sender, EventArgs e) { 521 if (Problem != null) Problem.ProblemData.TrainingPartition.End = SamplesEnd.Value; 527 samplesChanged = true; 528 if (Problem != null) problem.ProblemData.TrainingPartition.End = SamplesEnd.Value; 529 samplesChanged = false; 522 530 } 523 531 … … 543 551 throw new ArgumentException("A cross validation algorithm can only contain DataAnalysisProblems."); 544 552 } 545 algorithm.Problem.Reset += (x, y) => OnProblemChanged();553 algorithm.Problem.Reset += (x, y) => OnProblemChanged(); 546 554 problem = (IDataAnalysisProblem)algorithm.Problem; 547 555 OnProblemChanged(); … … 551 559 EventHandler handler = ProblemChanged; 552 560 if (handler != null) handler(this, EventArgs.Empty); 561 if (samplesChanged) return; 553 562 554 563 SamplesStart.Value = 0;
Note: See TracChangeset
for help on using the changeset viewer.