mirror of
https://github.com/dgirardeau/q3DMASC.git
synced 2026-08-29 08:34:48 +08:00
ec5507be5b
When the option is selected, overall accuracy, features and classifiers are saved
40 lines
802 B
C++
40 lines
802 B
C++
#ifndef CONFUSIONMATRIX_H
|
|
#define CONFUSIONMATRIX_H
|
|
|
|
#include <QWidget>
|
|
|
|
#include "CCTypes.h"
|
|
|
|
#include <opencv2/core/mat.hpp>
|
|
|
|
namespace Ui {
|
|
class ConfusionMatrix;
|
|
}
|
|
|
|
class ConfusionMatrix : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
enum metrics
|
|
{
|
|
PRECISION = 0,
|
|
RECALL = 1,
|
|
F1_SCORE = 2
|
|
};
|
|
|
|
explicit ConfusionMatrix(std::vector<ScalarType>& actual, std::vector<ScalarType>& predicted, QWidget *parent = nullptr);
|
|
~ConfusionMatrix();
|
|
|
|
void computePrecisionRecallF1Score(cv::Mat& matrix, cv::Mat& precisionRecallF1Score);
|
|
float computeOverallAccuracy(cv::Mat& matrix);
|
|
void compute(std::vector<ScalarType>& actual, std::vector<ScalarType>& predicted);
|
|
void setSessionRun(QString session, int run);
|
|
float m_overallAccuracy;
|
|
|
|
private:
|
|
Ui::ConfusionMatrix *ui;
|
|
};
|
|
|
|
#endif // CONFUSIONMATRIX_H
|