123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- //
- // Created by lenovo on 2023/10/16.
- //
- #ifndef ALGORITHM_GREYCLUSTEREVALUATION_H
- #define ALGORITHM_GREYCLUSTEREVALUATION_H
- #include <QVector>
- struct GCERange
- {
- int level; // 等级
- double left_left;
- double left_val;
- double right_val;
- double right_right;
- };
- struct GCEmat
- {
- double front_val;
- double back_val;
- };
- struct BestIndex
- {
- int front_index;
- int back_index;
- };
- typedef QVector<GCEmat> GCEMat;
- typedef QVector<QVector<GCERange>> GCERangeMat;
- /**
- * @brief 灰色聚类
- */
- class GreyClusterEvaluation
- {
- public:
- /**
- *
- * @param mat : 输入矩阵,一行代表一个指标, 指标中front_val,back_val表示前后样本
- * @param ranges : 各项指标的评价等级
- */
- GreyClusterEvaluation(const GCEMat &mat, const GCERangeMat &ranges);
- void evaluate(const QVector<double> &weights);
- BestIndex getBestIndex() const;
- const QVector<GCEmat> &getRangeWeights() const;
- const QVector<GCEMat> &getRangeCVT() const;
- int sample_num_; // 样本数
- int level_num_; // 等级数
- private:
- void triangularwhiteningweight(int sam, double front_val, double back_val);
- void evaluationlevel(const QVector<double> &weights);
- GCEMat mat_;
- GCERangeMat ranges_;
- QVector<GCEMat> ranges_cv_;
- QVector<GCEmat> ranges_weight_;
- };
- #endif // ALGORITHM_GREYCLUSTEREVALUATION_H
|