BALL 1.5.0
classificationValidation.h
Go to the documentation of this file.
1// -*- Mode: C++; tab-width: 2; -*-
2// vi: set ts=2:
3//
4//
5
6#ifndef CLASVALIDATION
7#define CLASVALIDATION
8
9#ifndef QSARDATA
10#include <BALL/QSAR/QSARData.h>
11#endif
12
13#ifndef VALIDATION
15#endif
16
17#include <iterator>
18
19
20namespace BALL
21{
22 namespace QSAR
23 {
24 class ClassificationModel;
27 {
28 public:
35
36 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
38
39
43 void crossValidation(int k, bool restore=1);
44
45 double getCVRes();
46
47 double getFitRes();
48
49 void setCVRes(double d);
50
51 void testInputData(bool transform=0);
52
54 const Eigen::MatrixXd* getConfusionMatrix();
55
57 const Eigen::VectorXd* getClassResults();
58
61 void bootstrap(int k, bool restore=1);
62
66 const Eigen::MatrixXd& yRandomizationTest(int runs, int k);
67
69 double getAccuracyCV();
70
73
74 void selectStat(int s);
75
76 void saveToFile(string filename) const;
77
78 void saveToFile(string filename, const double& quality_input_test, const double& predictive_quality) const;
79
80 void readFromFile(string filename);
81
83
84
85 private:
90 void testAllSubstances(bool transform);
91
93 void calculateAverageSensitivity();
94
96 void calculateWeightedSensitivity();
97
99 void calculateOverallAccuracy();
100
102 void calculateAverageMCC();
103
105 void calculateOverallMCC();
106
108 void calculateTDR();
110
111
116 Eigen::MatrixXd confusion_matrix_;
117
119 Eigen::VectorXd class_results_;
120
121 double quality_;
122
123 double quality_input_test_;
124
125 double quality_cv_;
126
128 ClassificationModel* clas_model;
129
130 void (ClassificationValidation::* qualCalculation)();
131
132
134
135 };
136 }
137}
138
139
140
141#endif // REGVALIDATION
Definition: constants.h:13
BALL_EXTERN_VARIABLE const double k
Definition: constants.h:93
ClassificationValidation(ClassificationModel *m)
void crossValidation(int k, bool restore=1)
const Eigen::MatrixXd & yRandomizationTest(int runs, int k)
void saveToFile(string filename) const
void testInputData(bool transform=0)
void readFromFile(string filename)
void bootstrap(int k, bool restore=1)
void saveToFile(string filename, const double &quality_input_test, const double &predictive_quality) const
const Eigen::VectorXd * getClassResults()
const Eigen::MatrixXd * getConfusionMatrix()
#define BALL_EXPORT
Definition: COMMON/global.h:50