- Timestamp:
- 03/31/11 18:23:02 (14 years ago)
- Location:
- trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4
- Files:
-
- 2 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 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisModel.cs
r5809 r5914 20 20 #endregion 21 21 22 using System.Collections.Generic; 23 using System.Linq; 22 using System.Drawing; 24 23 using HeuristicLab.Common; 25 24 using HeuristicLab.Core; 26 using HeuristicLab.Data;27 25 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 28 using HeuristicLab.Operators;29 using HeuristicLab.Parameters;30 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 31 using HeuristicLab.Optimization;32 using System;33 using System.Drawing;34 27 35 28 namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
Note: See TracChangeset
for help on using the changeset viewer.