|
@@ -7,6 +7,29 @@
|
|
|
#include <numeric>
|
|
|
#include <cmath>
|
|
|
|
|
|
+/**
|
|
|
+ QVector<QVector<double>> pdata = { { 4.1, 3.9, 5.9, 4.9, 4, 6.1, 8.2, 6.5, 7.5, 6.8,
|
|
|
+ 7.4, 5.7, 2.4, 2.2, 1.9, 1.8, 15.9, 18.9, 18.8, 16.8 },
|
|
|
+ { 0.04, 0.08, 0.07, 0.23, 0.14, 0.23, 0.21, 0.13, 0.16, 0.04,
|
|
|
+ 0.05, 0.08, 0.14, 0.24, 0.11, 0.06, 0.2, 0.09, 0.12, 0.27 },
|
|
|
+ { 0.19, 0.38, 0.23, 1.03, 0.57, 1.19, 0.88, 0.8, 1.28, 0.17,
|
|
|
+ 0.33, 0.6, 0.23, 0.35, 0.3, 0.28, 1.05, 0.82, 0.8, 1.74 },
|
|
|
+ { 0.01, 0.18, 0.04, 0.3, 0.11, 0.47, 0.2, 0.26, 0.88, 0.02,
|
|
|
+ 0.06, 0.47, 0.04, 0.06, 0.1, 0.1, 0.21, 0.34, 0.39, 1.51 },
|
|
|
+ { 0.36, 0.19, 0.36, 1.4, 1.12, 0.93, 0.97, 0.52, 0.8, 0.24,
|
|
|
+ 0.39, 0.46, 0.94, 1.78, 0.5, 0.29, 1.84, 0.58, 0.76, 1.78 },
|
|
|
+ { 0.05, 0.04, 0.07, 0.09, 0.05, 0.07, 0.1, 0.09, 0.12, 0.11,
|
|
|
+ 0.1, 0.08, 0.02, 0.02, 0.04, 0.03, 0.12, 0.36, 0.26, 0.32 } };
|
|
|
+
|
|
|
+ EntropyWeights ew(pdata);
|
|
|
+
|
|
|
+ QVector<double> weights;
|
|
|
+ QVector<double> score;
|
|
|
+ ew.compute(weights, score);
|
|
|
+ qDebug() << score;
|
|
|
+ qDebug() << weights;
|
|
|
+ */
|
|
|
+
|
|
|
EntropyWeights::EntropyWeights(const EntropyMat &mat, const QVector<bool> &direction)
|
|
|
: ymin_(0.002), ymax_(0.996), mat_(mat), direction_(direction)
|
|
|
{
|