Loading...
Searching...
No Matches
BALL::QSAR::Validation Class Referenceabstract

`#include <BALL/QSAR/validation.h>`

Inheritance diagram for BALL::QSAR::Validation:

## Public Member Functions

Constructors and Destructors
| Validation (Model *m)
virtual | ~Validation ()

## Protected Attributes

Attributes
vector< vector< double > > | test_substances_
Eigen::MatrixXd | test_Y_
vector< string > | substances_names_
Model * | model_
int | validation_statistic_
Eigen::MatrixXd | 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 Eigen::MatrixXd & | getYRandResults () const
virtual void | testInputData (bool transform=0)=0
virtual void | bootstrap (int k, bool restore=1)=0
virtual const Eigen::MatrixXd & | 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 ()

## Detailed Description

interface class for validation of QSAR-models

Definition at line 23 of file validation.h.

## Constructor & Destructor Documentation

## Validation()

BALL::QSAR::Validation::Validation | ( | Model * | m | ) |

## ~Validation()

virtual BALL::QSAR::Validation::~Validation | ( |  | ) |

virtual

## Member Function Documentation

## bootstrap()

virtual void BALL::QSAR::Validation::bootstrap | ( | int | k,
|  | bool | restore = 1 )

pure virtual

Implemented in BALL::QSAR::ClassificationValidation, and BALL::QSAR::RegressionValidation.

## crossValidation()

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.

## getCVRes()

virtual double BALL::QSAR::Validation::getCVRes | ( |  | ) |

pure virtual

fetches the result of cross-validation

Implemented in BALL::QSAR::ClassificationValidation, and BALL::QSAR::RegressionValidation.

## getFitRes()

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.

## getStat()

int BALL::QSAR::Validation::getStat | ( |  | ) | const

return the ID of selected validation statistic

## getYRandResults()

const Eigen::MatrixXd & 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

## readFromFile()

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.

## saveToFile()

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.

## selectStat()

virtual void BALL::QSAR::Validation::selectStat | ( | int | s | ) |

pure virtual

select the desired statistic to be used for validating the models

Parameters

  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.

## setCVRes()

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.

## setTestLine()

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

Parameters

  back_transform | descriptor values are transformed back to in order to un-do centering

## setTrainingLine()

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

## testInputData()

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!).

Parameters

  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.

## yRand()

void BALL::QSAR::Validation::yRand | ( |  | ) |

protected

randomizes all columns of Model.Y_

## yRandomizationTest()

virtual const Eigen::MatrixXd & BALL::QSAR::Validation::yRandomizationTest | ( | int | runs,
|  | int | k )

pure virtual

Implemented in BALL::QSAR::ClassificationValidation, and BALL::QSAR::RegressionValidation.

## Member Data Documentation

## model_

Model* BALL::QSAR::Validation::model_

protected

pointer to the model, which the object of this class should test

Definition at line 114 of file validation.h.

## substances_names_

vector<string> BALL::QSAR::Validation::substances_names_

protected

contains the names of all current test-substances

Definition at line 110 of file validation.h.

## test_substances_

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 104 of file validation.h.

## test_Y_

Eigen::MatrixXd 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 107 of file validation.h.

## validation_statistic_

int BALL::QSAR::Validation::validation_statistic_

protected

the selected validation statistic

Definition at line 117 of file validation.h.

## yRand_results_

Eigen::MatrixXd BALL::QSAR::Validation::yRand_results_

protected

Definition at line 119 of file validation.h.