Free cookie consent management tool by TermsFeed Policy Generator

Changeset 18202 for branches


Ignore:
Timestamp:
01/17/22 15:43:46 (3 years ago)
Author:
pfleck
Message:

#3040 Fixed best result analysis for non-plus selection.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SegmentOptimization/SegmentOptimizationProblem.cs

    r18186 r18202  
    156156      double diff = target - prediction;
    157157
     158      if (results.TryGetValue("AggValue Diff", out var oldDiffResult)) {
     159        var oldDiff = (DoubleValue)oldDiffResult.Value;
     160        if (Math.Abs(oldDiff.Value) < Math.Abs(diff)) return;
     161      }
     162
    158163      results.AddOrUpdateResult("Bounds", bounds);
    159164
     
    180185      var array = new double[data.Columns];
    181186      for (int row = 0; row < data.Rows; row++) {
    182         for (int i = 0; i < array.Length; i++) array[i] = data[row, i];
    183 
    184         var vector = DoubleVector.Build.DenseOfArray(array);
    185         var segment = vector.SubVector(bounds.Start, bounds.Size);
     187        for (int i = 0; i < array.Length; i++)
     188          array[i] = data[row, i];
     189                                                       
     190        //var vector = DoubleVector.Build.DenseOfArray(array);
     191        //var segment = vector.SubVector(bounds.Start, bounds.Size);
     192        var segment = DoubleVector.Build.DenseOfEnumerable(array.Skip(bounds.Start).Take(bounds.Size));
    186193
    187194        switch (aggregation) {
Note: See TracChangeset for help on using the changeset viewer.