Free cookie consent management tool by TermsFeed Policy Generator

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

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

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  
    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  }
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisModel.cs

    r5809 r5914  
    2020#endregion
    2121
    22 using System.Collections.Generic;
    23 using System.Linq;
     22using System.Drawing;
    2423using HeuristicLab.Common;
    2524using HeuristicLab.Core;
    26 using HeuristicLab.Data;
    2725using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    28 using HeuristicLab.Operators;
    29 using HeuristicLab.Parameters;
    3026using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    31 using HeuristicLab.Optimization;
    32 using System;
    33 using System.Drawing;
    3427
    3528namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
Note: See TracChangeset for help on using the changeset viewer.