-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathconfusionmatrix.h
More file actions
46 lines (36 loc) · 1.08 KB
/
Copy pathconfusionmatrix.h
File metadata and controls
46 lines (36 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#pragma once
#include <QWidget>
#include <set>
#include <GenericDistribution.h>
#include <ccMainAppInterface.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( const CCCoreLib::GenericDistribution::ScalarContainer& actual,
const CCCoreLib::GenericDistribution::ScalarContainer& predicted );
~ConfusionMatrix() override;
void computePrecisionRecallF1Score(cv::Mat& matrix, cv::Mat& precisionRecallF1Score, cv::Mat &vec_TP_FN);
float computeOverallAccuracy(cv::Mat& matrix);
void compute( const CCCoreLib::GenericDistribution::ScalarContainer& actual,
const CCCoreLib::GenericDistribution::ScalarContainer& predicted );
void setSessionRun(QString session, int run);
bool save(QString filePath);
float getOverallAccuracy() const;
private:
Ui::ConfusionMatrix* m_ui;
cv::Mat m_confusionMatrix;
cv::Mat m_precisionRecallF1Score;
std::vector<ScalarType> m_classNumbers;
float m_overallAccuracy;
};