Loading...
Searching...
No Matches
BALL::QSAR::ClassificationValidation Class Reference

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

Inheritance diagram for BALL::QSAR::ClassificationValidation:

## Public Member Functions

Constructors and Destructors
| ClassificationValidation (ClassificationModel *m)
Public Member Functions inherited from BALL::QSAR::Validation
| Validation (Model *m)
virtual | ~Validation ()
const Eigen::MatrixXd & | getYRandResults () const
int | getStat () const

## Accessors

void | crossValidation (int k, bool restore=1)
double | getCVRes ()
double | getFitRes ()
void | setCVRes (double d)
void | testInputData (bool transform=0)
const Eigen::MatrixXd * | getConfusionMatrix ()
const Eigen::VectorXd * | getClassResults ()
void | bootstrap (int k, bool restore=1)
const Eigen::MatrixXd & | yRandomizationTest (int runs, int k)
double | getAccuracyCV ()
double | getAccuracyInputTest ()
void | selectStat (int s)
void | saveToFile (string filename) const
void | saveToFile (string filename, const double &quality_input_test, const double &predictive_quality) const
void | readFromFile (string filename)

## Additional Inherited Members

void | setTrainingLine (int train_line, int current_line)
void | setTestLine (int test_line, int current_line, bool back_transform=0)
void | yRand ()
Protected Attributes inherited from BALL::QSAR::Validation
vector< vector< double > > | test_substances_
Eigen::MatrixXd | test_Y_
vector< string > | substances_names_
Model * | model_
int | validation_statistic_
Eigen::MatrixXd | yRand_results_

## Detailed Description

class for validation of QSAR regression models

Definition at line 26 of file classificationValidation.h.

## Constructor & Destructor Documentation

## ClassificationValidation()

BALL::QSAR::ClassificationValidation::ClassificationValidation | ( | ClassificationModel * | m | ) |

constructor

Parameters

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

## Member Function Documentation

## bootstrap()

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

virtual

starts bootstrapping with k samples

Parameters

  k | no of bootstrap samples

Implements BALL::QSAR::Validation.

## crossValidation()

void BALL::QSAR::ClassificationValidation::crossValidation | ( | int | k,
|  | bool | restore = 1 )

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)

Implements BALL::QSAR::Validation.

## getAccuracyCV()

double BALL::QSAR::ClassificationValidation::getAccuracyCV | ( |  | ) |

get average accuracy value as determined after cross validation

## getAccuracyInputTest()

double BALL::QSAR::ClassificationValidation::getAccuracyInputTest | ( |  | ) |

get average accuracy value as determined after testing of input data();

## getClassResults()

const Eigen::VectorXd * BALL::QSAR::ClassificationValidation::getClassResults | ( |  | ) |

returns a RowVector holding the one value contituting the validation result for each class if "average accuracy" or "average MCC" is chosen (see selectStat()).

## getConfusionMatrix()

const Eigen::MatrixXd * BALL::QSAR::ClassificationValidation::getConfusionMatrix | ( |  | ) |

return pointer to the matrix containing the number of TP, FP, TN, FN in one column for each class

## getCVRes()

double BALL::QSAR::ClassificationValidation::getCVRes | ( |  | ) |

virtual

fetches the result of cross-validation

Implements BALL::QSAR::Validation.

## getFitRes()

double BALL::QSAR::ClassificationValidation::getFitRes | ( |  | ) |

virtual

fetches the quality of fit to the input data, as calculated by testInputData()

Implements BALL::QSAR::Validation.

## readFromFile()

void BALL::QSAR::ClassificationValidation::readFromFile | ( | string | filename | ) |

virtual

restore validation-results from a file

Implements BALL::QSAR::Validation.

## saveToFile() [1/2]

void BALL::QSAR::ClassificationValidation::saveToFile | ( | string | filename | ) | const

virtual

save the result of the applied validation methods to a file

Implements BALL::QSAR::Validation.

## saveToFile() [2/2]

void BALL::QSAR::ClassificationValidation::saveToFile | ( | string | filename,
|  | const double & | quality_input_test,
|  | const double & | predictive_quality ) const

## selectStat()

void BALL::QSAR::ClassificationValidation::selectStat | ( | int | s | ) |

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.

Implements BALL::QSAR::Validation.

## setCVRes()

void BALL::QSAR::ClassificationValidation::setCVRes | ( | double | d | ) |

virtual

set the result of cross-validation to the given value

Implements BALL::QSAR::Validation.

## testInputData()

void BALL::QSAR::ClassificationValidation::testInputData | ( | bool | transform = 0 | ) |

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

Implements BALL::QSAR::Validation.

## yRandomizationTest()

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

virtual

Y randomization test
Randomizes all columns of model.Y, trains the model, runs crossValidation and testInputData and saves the resulting accuracy_input_test and accuracy_cv value to a vector, where Eigen::MatrixXd(i,0)=accuracy_input_test, Eigen::MatrixXd(i,1)=accuracy_cv

Parameters

  runs | this is repeated as often as specified by 'runs'

Implements BALL::QSAR::Validation.