- Timestamp:
- 03/31/11 18:23:02 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Evaluators/SymbolicDataAnalysisEvaluator.cs
r5906 r5914 90 90 91 91 protected IEnumerable<int> GenerateRowsToEvaluate() { 92 int seed = RandomParameter.ActualValue.Next(); 92 return GenerateRowsToEvaluate(RelativeNumberOfEvaluatedSamplesParameter.ActualValue.Value); 93 } 94 95 protected IEnumerable<int> GenerateRowsToEvaluate(double percentageOfRows) { 96 97 98 IEnumerable<int> rows; 93 99 int samplesStart = EvaluationPartitionParameter.ActualValue.Start; 94 100 int samplesEnd = EvaluationPartitionParameter.ActualValue.End; … … 97 103 98 104 if (samplesEnd < samplesStart) throw new ArgumentException("Start value is larger than end value."); 99 int count = (int)((samplesEnd - samplesStart) * RelativeNumberOfEvaluatedSamplesParameter.ActualValue.Value); 100 if (count == 0) count = 1; 101 return RandomEnumerable.SampleRandomNumbers(seed, samplesStart, samplesEnd, count) 102 .Where(i => i < testPartitionStart || testPartitionEnd <= i); 105 106 if (percentageOfRows.IsAlmost(1.0)) 107 rows = Enumerable.Range(samplesStart, samplesEnd - samplesStart); 108 else { 109 int seed = RandomParameter.ActualValue.Next(); 110 int count = (int)((samplesEnd - samplesStart) * percentageOfRows); 111 if (count == 0) count = 1; 112 rows = RandomEnumerable.SampleRandomNumbers(seed, samplesStart, samplesEnd, count); 113 } 114 115 return rows.Where(i => i < testPartitionStart || testPartitionEnd <= i); 103 116 } 104 117 }
Note: See TracChangeset
for help on using the changeset viewer.