#include <BALL/QSAR/allModel.h>
Public Member Functions | |
Constructors and Destructors | |
ALLModel (const QSARData &q, double kw=4) | |
~ALLModel () | |
Protected Attributes | |
Attributes | |
double | kw_ |
double | lambda_ |
Accessors | |
| |
void | setKw (double kw) |
virtual Vector< double > | predict (const vector< double > &substance, bool transform=1) |
void | train () |
virtual bool | optimizeParameters (int d, int no_steps) |
double | getKw () |
virtual void | setParameters (vector< double > &v) |
virtual vector< double > | getParameters () const |
void | saveToFile (string filename) |
void | readFromFile (string filename) |
virtual void | calculateWeights (BALL::Matrix< double > &dist, BALL::Vector< double > &w) |
void | calculateXX (BALL::Vector< double > &w, BALL::Matrix< double > &res) |
void | calculateXY (BALL::Vector< double > &w, BALL::Matrix< double > &res) |
void | calculateEuclDistanceMatrix (BALL::Matrix< double > &m1, BALL::Matrix< double > &m2, BALL::Matrix< double > &output) |
class for automated lazy learning (ALL-QSAR)
Definition at line 40 of file allModel.h.
BALL::QSAR::ALLModel::~ALLModel | ( | ) |
void BALL::QSAR::ALLModel::calculateEuclDistanceMatrix | ( | BALL::Matrix< double > & | m1, | |
BALL::Matrix< double > & | m2, | |||
BALL::Matrix< double > & | output | |||
) | [protected] |
calculates pairwise euclidean distance between all substances of m1 and m2 and saves them to BALL::Matrix<double> output
virtual void BALL::QSAR::ALLModel::calculateWeights | ( | BALL::Matrix< double > & | dist, | |
BALL::Vector< double > & | w | |||
) | [protected, virtual] |
void BALL::QSAR::ALLModel::calculateXX | ( | BALL::Vector< double > & | w, | |
BALL::Matrix< double > & | res | |||
) | [protected] |
calculates weighted BALL::Matrix<double> X^T*X
void BALL::QSAR::ALLModel::calculateXY | ( | BALL::Vector< double > & | w, | |
BALL::Matrix< double > & | res | |||
) | [protected] |
calculates weighted BALL::Matrix<double> X^T*Y
double BALL::QSAR::ALLModel::getKw | ( | ) |
returns the current kernel width
virtual vector<double> BALL::QSAR::ALLModel::getParameters | ( | ) | const [virtual] |
Reimplemented from BALL::QSAR::Model.
Reimplemented in BALL::QSAR::KNNModel.
virtual bool BALL::QSAR::ALLModel::optimizeParameters | ( | int | d, | |
int | no_steps | |||
) | [virtual] |
Tries to find the optimal kernel width for the current data. Therefore some training data must have been read by the connected QSARData object before running this method.
Reimplemented from BALL::QSAR::Model.
Reimplemented in BALL::QSAR::KNNModel.
virtual Vector<double> BALL::QSAR::ALLModel::predict | ( | const vector< double > & | substance, | |
bool | transform = 1 | |||
) | [virtual] |
Predicts the activities of a given substance
substance | the substance which activity is to be predicted in form of a vecor containing the values for *all* descriptors (if neccessary, relevant descriptors will be selected automatically) | |
transform | determines whether the values for each descriptor of the given substance should be transformed before prediction of activity. If (transform==1): each descriptor value is transformed according to the centering of the respective column of QSARData.descriptor_matrix used to train this model. If the substance to be predicted is part of the same input data (e.g. same SD-file) as the training data (as is the case during cross validation), transform should therefore be set to 0. |
Implements BALL::QSAR::Model.
void BALL::QSAR::ALLModel::readFromFile | ( | string | filename | ) | [virtual] |
reconstruct a saved Model from a file
Reimplemented from BALL::QSAR::RegressionModel.
void BALL::QSAR::ALLModel::saveToFile | ( | string | filename | ) | [virtual] |
save Model to a file
Reimplemented from BALL::QSAR::RegressionModel.
void BALL::QSAR::ALLModel::setKw | ( | double | kw | ) |
virtual void BALL::QSAR::ALLModel::setParameters | ( | vector< double > & | ) | [virtual] |
sets the model parameters according to the given values.
Reimplemented from BALL::QSAR::Model.
Reimplemented in BALL::QSAR::KNNModel.
void BALL::QSAR::ALLModel::train | ( | ) | [inline, virtual] |
automated lazy learning does not have a seperate training step
Implements BALL::QSAR::Model.
Definition at line 59 of file allModel.h.
double BALL::QSAR::ALLModel::kw_ [protected] |
kernel width
Definition at line 99 of file allModel.h.
double BALL::QSAR::ALLModel::lambda_ [protected] |
Definition at line 100 of file allModel.h.