Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/31/11 18:23:02 (13 years ago)
Author:
mkommend
Message:

#1418: Changed DataAnalysisSolutions and -Models and updated GenerateRowsToEvaluate method in SymbolicDataAnalysisEvaluator.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Evaluators/SymbolicDataAnalysisEvaluator.cs

    r5906 r5914  
    9090
    9191    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;
    9399      int samplesStart = EvaluationPartitionParameter.ActualValue.Start;
    94100      int samplesEnd = EvaluationPartitionParameter.ActualValue.End;
     
    97103
    98104      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);
    103116    }
    104117  }
Note: See TracChangeset for help on using the changeset viewer.