#include <BALL/QSAR/validation.h>
Public Member Functions | |
Constructors and Destructors | |
Validation (Model *m) | |
virtual | ~Validation () |
Protected Attributes | |
Attributes | |
vector< vector< double > > | test_substances_ |
Matrix< double > | test_Y_ |
vector< string > | substances_names_ |
Model * | model_ |
int | validation_statistic_ |
Matrix< double > | yRand_results_ |
Accessors | |
| |
virtual void | crossValidation (int k, bool restore=1)=0 |
virtual double | getCVRes ()=0 |
virtual double | getFitRes ()=0 |
virtual void | setCVRes (double d)=0 |
const Matrix< double > & | getYRandResults () const |
virtual void | testInputData (bool transform=0)=0 |
virtual void | bootstrap (int k, bool restore=1)=0 |
virtual const Matrix< double > & | yRandomizationTest (int runs, int k)=0 |
virtual void | selectStat (int s)=0 |
int | getStat () const |
virtual void | saveToFile (string filename) const =0 |
virtual void | readFromFile (string filename)=0 |
void | setTrainingLine (int train_line, int current_line) |
void | setTestLine (int test_line, int current_line, bool back_transform=0) |
void | yRand () |
interface class for validation of QSAR-models
Definition at line 45 of file validation.h.
BALL::QSAR::Validation::Validation | ( | Model * | m | ) |
virtual BALL::QSAR::Validation::~Validation | ( | ) | [virtual] |
virtual void BALL::QSAR::Validation::bootstrap | ( | int | k, | |
bool | restore = 1 | |||
) | [pure virtual] |
Implemented in BALL::QSAR::ClassificationValidation, and BALL::QSAR::RegressionValidation.
virtual void BALL::QSAR::Validation::crossValidation | ( | int | k, | |
bool | restore = 1 | |||
) | [pure virtual] |
Starts cross-validation with k steps.
Data is taken from QSARData.descriptor_matrix and is in each step divided into training- and test-data.
(Data having already been copied into Model.descriptor_matrix will be deleted)
Implemented in BALL::QSAR::ClassificationValidation, and BALL::QSAR::RegressionValidation.
virtual double BALL::QSAR::Validation::getCVRes | ( | ) | [pure virtual] |
fetches the result of cross-validation
Implemented in BALL::QSAR::ClassificationValidation, and BALL::QSAR::RegressionValidation.
virtual double BALL::QSAR::Validation::getFitRes | ( | ) | [pure virtual] |
fetches the quality of fit to the input data, as calculated by testInputData()
Implemented in BALL::QSAR::ClassificationValidation, and BALL::QSAR::RegressionValidation.
int BALL::QSAR::Validation::getStat | ( | ) | const |
return the ID of selected validation statistic
const Matrix<double>& BALL::QSAR::Validation::getYRandResults | ( | ) | const |
return the result of the previous response permutation test .
The return matrix is empty if no such test has been run yet
virtual void BALL::QSAR::Validation::readFromFile | ( | string | filename | ) | [pure virtual] |
restore validation-results from a file
Implemented in BALL::QSAR::ClassificationValidation, and BALL::QSAR::RegressionValidation.
virtual void BALL::QSAR::Validation::saveToFile | ( | string | filename | ) | const [pure virtual] |
save the result of the applied validation methods to a file
Implemented in BALL::QSAR::ClassificationValidation, and BALL::QSAR::RegressionValidation.
virtual void BALL::QSAR::Validation::selectStat | ( | int | s | ) | [pure virtual] |
select the desired statistic to be used for validating the models
s | if (s==1) R^2 and Q^2 are used if(s==2) F_regr and F_cv are used. |
Implemented in BALL::QSAR::ClassificationValidation, and BALL::QSAR::RegressionValidation.
virtual void BALL::QSAR::Validation::setCVRes | ( | double | d | ) | [pure virtual] |
set the result of cross-validation to the given value
Implemented in BALL::QSAR::ClassificationValidation, and BALL::QSAR::RegressionValidation.
void BALL::QSAR::Validation::setTestLine | ( | int | test_line, | |
int | current_line, | |||
bool | back_transform = 0 | |||
) | [protected] |
copies one substance (=one line from class QSARData) and its activity into the test data set
back_transform | descriptor values are transformed back to in order to un-do centering |
void BALL::QSAR::Validation::setTrainingLine | ( | int | train_line, | |
int | current_line | |||
) | [protected] |
copies one substance (=one line from class QSARData) and its activity into the training data set
virtual void BALL::QSAR::Validation::testInputData | ( | bool | transform = 0 |
) | [pure virtual] |
Fetches input data from QSARData and tests the current (unchanged) model with all these new substances (without cross-validation!).
transform | if transform==1, the test data is transformed in the same way that the training data was transformed before predicting activities. If training and test substances are taken from the same input file, set transform to 0 |
Implemented in BALL::QSAR::ClassificationValidation, and BALL::QSAR::RegressionValidation.
void BALL::QSAR::Validation::yRand | ( | ) | [protected] |
randomizes all columns of Model.Y_
virtual const Matrix<double>& BALL::QSAR::Validation::yRandomizationTest | ( | int | runs, | |
int | k | |||
) | [pure virtual] |
Implemented in BALL::QSAR::ClassificationValidation, and BALL::QSAR::RegressionValidation.
Model* BALL::QSAR::Validation::model_ [protected] |
pointer to the model, which the object of this class should test
Definition at line 134 of file validation.h.
vector<string> BALL::QSAR::Validation::substances_names_ [protected] |
contains the names of all current test-substances
Definition at line 130 of file validation.h.
vector<vector<double> > BALL::QSAR::Validation::test_substances_ [protected] |
contains all substances whose activities are to be predicted by the next call of testAllSubstances()
Definition at line 124 of file validation.h.
Matrix<double> BALL::QSAR::Validation::test_Y_ [protected] |
contains the experimentally determined results (activities) for all current test-substances in one column for each activity
Definition at line 127 of file validation.h.
int BALL::QSAR::Validation::validation_statistic_ [protected] |
the selected validation statistic
Definition at line 137 of file validation.h.
Matrix<double> BALL::QSAR::Validation::yRand_results_ [protected] |
Definition at line 139 of file validation.h.