Changeset 5886 for trunk/sources/HeuristicLab.Algorithms.DataAnalysis
- Timestamp:
- 03/30/11 14:01:20 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/CrossValidation.cs
r5809 r5886 31 31 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 32 32 using HeuristicLab.Problems.DataAnalysis; 33 using HeuristicLab.Problems.DataAnalysis.Symbolic; 33 34 34 35 namespace HeuristicLab.Algorithms.DataAnalysis { … … 267 268 if (clonedAlgorithms.Count == 0) { 268 269 int testSamplesCount = (SamplesEnd.Value - SamplesStart.Value) / Folds.Value; 270 269 271 for (int i = 0; i < Folds.Value; i++) { 270 272 IAlgorithm clonedAlgorithm = (IAlgorithm)algorithm.Clone(); 271 273 clonedAlgorithm.Name = algorithm.Name + " Fold " + i; 272 274 IDataAnalysisProblem problem = clonedAlgorithm.Problem as IDataAnalysisProblem; 273 problem.ProblemData.TestPartition.End = (i + 1) == Folds.Value ? SamplesEnd.Value : (i + 1) * testSamplesCount + SamplesStart.Value; 274 problem.ProblemData.TestPartition.Start = (i * testSamplesCount) + SamplesStart.Value; 275 ISymbolicDataAnalysisProblem symbolicProblem = problem as ISymbolicDataAnalysisProblem; 276 277 int testStart = (i * testSamplesCount) + SamplesStart.Value; 278 int testEnd = (i + 1) == Folds.Value ? SamplesEnd.Value : (i + 1) * testSamplesCount + SamplesStart.Value; 279 280 problem.ProblemData.TestPartition.Start = testStart; 281 problem.ProblemData.TestPartition.End = testEnd; 282 DataAnalysisProblemData problemData = problem.ProblemData as DataAnalysisProblemData; 283 if (problemData != null) { 284 problemData.TrainingPartitionParameter.Hidden = false; 285 problemData.TestPartitionParameter.Hidden = false; 286 } 287 288 if (symbolicProblem != null) { 289 symbolicProblem.FitnessCalculationPartition.Start = SamplesStart.Value; 290 symbolicProblem.FitnessCalculationPartition.End = SamplesEnd.Value; 291 } 292 275 293 clonedAlgorithms.Add(clonedAlgorithm); 276 294 } … … 447 465 Problem.ProblemDataChanged += (object sender, EventArgs e) => OnProblemChanged(); 448 466 SamplesEnd.Value = Problem.ProblemData.Dataset.Rows; 467 468 DataAnalysisProblemData problemData = Problem.ProblemData as DataAnalysisProblemData; 469 if (problemData != null) { 470 problemData.TrainingPartitionParameter.Hidden = true; 471 problemData.TestPartitionParameter.Hidden = true; 472 } 473 ISymbolicDataAnalysisProblem symbolicProblem = Problem as ISymbolicDataAnalysisProblem; 474 if (symbolicProblem != null) { 475 symbolicProblem.FitnessCalculationPartitionParameter.Hidden = true; 476 symbolicProblem.FitnessCalculationPartition.Start = SamplesStart.Value; 477 symbolicProblem.FitnessCalculationPartition.End = SamplesEnd.Value; 478 symbolicProblem.ValidationPartitionParameter.Hidden = true; 479 symbolicProblem.ValidationPartition.Start = 0; 480 symbolicProblem.ValidationPartition.End = 0; 481 } 449 482 } else 450 483 SamplesEnd.Value = 0;
Note: See TracChangeset
for help on using the changeset viewer.