Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/11/18 14:54:35 (5 years ago)
Author:
chaider
Message:

#2966

  • Changed signature of GetSymbolicExressionTreeIntervals methods
  • Changed PrepareInterpreterState (removed optinal parameters, takes Dictionary<string, Interval> as input and no dataset anymore)
  • Added optional parameter (rows) to GetVariableBoundaries method (allows to use just parts from dataset as input e.g. training/test indices)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2966_interval_calculation/HeuristicLab.Problems.DataAnalysis/3.4/DatasetUtil.cs

    r16363 r16364  
    9393    }
    9494
    95     public static Dictionary<string, Interval> GetVariableBoundaries(IDataset dataset) {
     95    public static Dictionary<string, Interval> GetVariableBoundaries(IDataset dataset, IEnumerable<int> rows = null) {
    9696      Dictionary<string, Interval> variableBoundaries = new Dictionary<string, Interval>();
    9797
     
    100100        var max = double.MinValue;
    101101
    102         foreach (var val in dataset.GetDoubleValues(variable)) {
    103           if (val < min) min = val;
    104           if (val > max) max = val;
     102        if (rows != null) {
     103          foreach (int row in rows) {
     104            var val = dataset.GetDoubleValue(variable, row);
     105            if (val < min) min = val;
     106            if (val > max) max = val;
     107          }
     108        } else {
     109          foreach (var val in dataset.GetDoubleValues(variable)) {
     110            if (val < min) min = val;
     111            if (val > max) max = val;
     112          }
    105113        }
    106114        variableBoundaries.Add(variable, new Interval(min, max));
Note: See TracChangeset for help on using the changeset viewer.