Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/14/12 18:48:07 (12 years ago)
Author:
gkronber
Message:

#1925 fixed some bugs in NormalDistributionCutPointsThresholdCalculator (probably more remaining)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis-3.4/ThresholdCalculatorsTest.cs

    r8638 r8658  
    111111      }
    112112
     113
     114      {
     115        // normal operation
     116        double[] estimatedValues = new double[]
     117                                     {
     118                                       2.9937,
     119                                       2.9861,
     120                                       1.0202,
     121                                       0.9844,
     122                                       1.9912,
     123                                       1.9970,
     124                                       0.9776,
     125                                       0.9611,
     126                                       1.9882,
     127                                       1.9953,
     128                                       2.0147,
     129                                       2.0106,
     130                                       2.9949,
     131                                       0.9925,
     132                                       3.0050,
     133                                       1.9987,
     134                                       2.9973,
     135                                       1.0110,
     136                                       2.0160,
     137                                       2.9559,
     138                                       1.9943,
     139                                       2.9477,
     140                                       2.0158,
     141                                       2.0026,
     142                                       1.9837,
     143                                       3.0185,
     144                                     };
     145        double[] targetClassValues = new double[]
     146                                       {
     147                                          3,
     148                                          3,
     149                                          1,
     150                                          1,
     151                                          2,
     152                                          2,
     153                                          1,
     154                                          1,
     155                                          2,
     156                                          2,
     157                                          2,
     158                                          2,
     159                                          3,
     160                                          1,
     161                                          3,
     162                                          2,
     163                                          3,
     164                                          1,
     165                                          2,
     166                                          3,
     167                                          2,
     168                                          3,
     169                                          2,
     170                                          2,
     171                                          2,
     172                                          3,
     173                                       };
     174
     175        double[] classValues;
     176        double[] thresholds;
     177        NormalDistributionCutPointsThresholdCalculator.CalculateThresholds(null, estimatedValues, targetClassValues,
     178                                                                           out classValues, out thresholds);
     179
     180
     181        var expectedClassValues = new double[] { 2.0, 1.0, 2.0, 3.0 };
     182        var expectedTresholds = new double[] { double.NegativeInfinity, -18.365068542315438, 1.6573010498191565, 2.314962133866949 };
     183
     184        AssertEqual(expectedClassValues, classValues);
     185        AssertEqual(expectedTresholds, thresholds);
     186      }
    113187    }
    114188
Note: See TracChangeset for help on using the changeset viewer.