BALL  1.4.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines
Classes
BALL::QSAR::RegressionValidation Class Reference

#include <BALL/QSAR/regressionValidation.h>

Inheritance diagram for BALL::QSAR::RegressionValidation:
BALL::QSAR::Validation

List of all members.

Classes

struct  BackupData

Public Member Functions

Constructors and Destructors
 RegressionValidation (RegressionModel *m)
 ~RegressionValidation ()

Accessors

void crossValidation (int k, bool restore=1)
void crossValidation (int k, vector< BALL::Matrix< double > > *results, bool restore=1)
void bootstrap (int k, bool restore=1)
void bootstrap (int k, vector< BALL::Matrix< double > > *results, bool restore=1)
void bootstrap1 (int k, vector< BALL::Matrix< double > > *results, bool restore=1)
const BALL::Matrix< double > & yRandomizationTest (int runs, int k)
double getQ2 ()
double getR2 ()
double getFregr ()
double getFcv ()
double getCVRes ()
double getFitRes ()
double getMaxError ()
void setCVRes (double d)
void setQ2 (double d)
void testInputData (bool transform=0)
void selectStat (int s)
void calculateCoefficientStdErrors (int k, bool b=1)
const BALL::Matrix< double > * getCoefficientStdErrors ()
void setCoefficientStdErrors (const BALL::Matrix< double > *stddev)
void saveToFile (string filename) const
void saveToFile (string filename, const double &r2, const double &q2, const Matrix< double > &coefficient_stddev, const Matrix< double > &yRand_results) const
void readFromFile (string filename)
void testAllSubstances (bool transform)
void backupTrainingResults ()
void restoreTrainingResults ()

Attributes

double ssR_
double ssE_
double ssY_
double std_err_
double Q2_
double F_cv_
double F_regr_
double R2_
double max_error_
double quality_
double(RegressionValidation::* predQualFetcher_ )()
double(RegressionValidation::* fitQualFetcher_ )()
BALL::Matrix< doublecoefficient_stderr_
RegressionModelregr_model_
BackupData backup_data_
void(RegressionValidation::* qualCalculation )()
void calculateQOF ()

Detailed Description

class for validation of QSAR regression models

Definition at line 53 of file regressionValidation.h.


Constructor & Destructor Documentation

constructor

Parameters:
mpointer to the regression model, which the object of this class should test

Member Function Documentation

void BALL::QSAR::RegressionValidation::bootstrap ( int  k,
bool  restore = 1 
) [virtual]

starts bootstrapping with k samples

Parameters:
kno of bootstrap samples
restoreif restore==1, Model.descriptor_matrix and RegressionModel.training_result is restored after bootstrapping

Implements BALL::QSAR::Validation.

void BALL::QSAR::RegressionValidation::bootstrap ( int  k,
vector< BALL::Matrix< double > > *  results,
bool  restore = 1 
)

starts bootstrapping with k samples

Parameters:
kno of bootstrap samples
restoreif restore==1, Model.descriptor_matrix and RegressionModel.training_result is restored after bootstrapping
resultspointer to vector that should take all matrices RegressionModel.training_result produced during this bootstrapping
void BALL::QSAR::RegressionValidation::bootstrap1 ( int  k,
vector< BALL::Matrix< double > > *  results,
bool  restore = 1 
)

calculates standart deviations for all predicted coefficients and saves them to coefficient_stddev_

Parameters:
bif b==1, bootstrapping is used; else: cross-validation
knumber of bootstrap samples resp. cross-validation steps
void BALL::QSAR::RegressionValidation::crossValidation ( int  k,
bool  restore = 1 
) [virtual]

starts k-fold cross validation

Parameters:
kno of cross validation folds
restoreif restore==1, Model.descriptor_matrix and RegressionModel.training_result is restored after cross validation

Implements BALL::QSAR::Validation.

void BALL::QSAR::RegressionValidation::crossValidation ( int  k,
vector< BALL::Matrix< double > > *  results,
bool  restore = 1 
)

starts k-fold cross validation

Parameters:
kno of cross validation folds
restoreif restore==1, Model.descriptor_matrix and RegressionModel.training_result is restored after cross validation
resultspointer to vector that should take all matrices RegressionModel.training_result produced during this cross validation run

returns a const pointer to the matrix containing the standart deviations of all predicted coefficients

fetches the result of cross-validation

Implements BALL::QSAR::Validation.

get the F-value as calculated by cross validation.
If crossValidation() has not been run yet, -1 is returned

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

Implements BALL::QSAR::Validation.

get the F-value as calculated by testInputData().
If testInputData() has not been run yet, -1 is returned

returns the maximal error of the prediction

get the Q^2 value.
If no cross-validation has been done yet, -1 is returned

get the R^2 value.
If testInputData() has not been run yet, -1 is returned

void BALL::QSAR::RegressionValidation::readFromFile ( string  filename) [virtual]

restore validation-results from a file

Implements BALL::QSAR::Validation.

void BALL::QSAR::RegressionValidation::saveToFile ( string  filename) const [virtual]

save the result of the applied validation methods to a file

Implements BALL::QSAR::Validation.

void BALL::QSAR::RegressionValidation::saveToFile ( string  filename,
const double r2,
const double q2,
const Matrix< double > &  coefficient_stddev,
const Matrix< double > &  yRand_results 
) const

select the desired statistic to be used for validating the models

Parameters:
sif (s==1) R^2 and Q^2 are used
if(s==2) F_regr and F_cv are used.

Implements BALL::QSAR::Validation.

void BALL::QSAR::RegressionValidation::setCoefficientStdErrors ( const BALL::Matrix< double > *  stddev)

set the result of cross-validation to the given value

Implements BALL::QSAR::Validation.

set the Q^2 value

Tests the current model with all substances in the (unchanged) test data set

void BALL::QSAR::RegressionValidation::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:
transformif 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.

const BALL::Matrix<double>& BALL::QSAR::RegressionValidation::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 R2 and Q2 value to a matrix with 2 columns; the R2 values makeing up the first colum, the Q2 value the second.

Parameters:
runsthis is repeated as often as specified by 'runs'

Implements BALL::QSAR::Validation.


Member Data Documentation

Definition at line 221 of file regressionValidation.h.

contains the standart deviations of all predicted coefficients in one column for each modelled activity

Definition at line 216 of file regressionValidation.h.

F-value as calculated after cross-validation

Definition at line 197 of file regressionValidation.h.

F-value as calculated after regression for input data

Definition at line 200 of file regressionValidation.h.

double(RegressionValidation::* BALL::QSAR::RegressionValidation::fitQualFetcher_)() [private]

Definition at line 211 of file regressionValidation.h.

Definition at line 204 of file regressionValidation.h.

double(RegressionValidation::* BALL::QSAR::RegressionValidation::predQualFetcher_)() [private]

Definition at line 209 of file regressionValidation.h.

Q^2-value as calculated after cross-validation

Definition at line 194 of file regressionValidation.h.

void(RegressionValidation::* BALL::QSAR::RegressionValidation::qualCalculation)() [private]

Definition at line 223 of file regressionValidation.h.

the quality as calcated by the last call of testAllSubstances() according to the chose quality-statistic

Definition at line 207 of file regressionValidation.h.

Definition at line 202 of file regressionValidation.h.

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

Definition at line 219 of file regressionValidation.h.

Definition at line 185 of file regressionValidation.h.

Definition at line 183 of file regressionValidation.h.

the sum of squares of the response

Definition at line 188 of file regressionValidation.h.

standart error

Definition at line 191 of file regressionValidation.h.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines