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

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

Inheritance diagram for BALL::QSAR::RegressionModel:

## Public Member Functions

Constructors and Destructors
| RegressionModel (const QSARData &q)
| ~RegressionModel ()
virtual EIGEN_MAKE_ALIGNED_OPERATOR_NEW void | operator= (const RegressionModel &m)
Public Member Functions inherited from BALL::QSAR::Model
| Model (const QSARData &q)
virtual | ~Model ()
virtual void | operator= (const Model &m)
void | copyData (const Model &m)
void | copyDescriptorIDs (const Model &m)
void | readTrainingData ()
virtual Eigen::VectorXd | predict (const vector< double > &substance, bool transform)=0
void | deleteDescriptorIDs ()
virtual void | train ()=0
virtual bool | optimizeParameters (int, int)
bool | optimizeParameters (int k)
virtual double | calculateStdErr ()
virtual void | setParameters (vector< double > &)
virtual vector< double > | getParameters () const
std::multiset< unsigned int > * | getDescriptorIDs ()
void | setDataSource (const QSARData *q)
const Eigen::MatrixXd * | getDescriptorMatrix ()
const vector< string > * | getSubstanceNames ()
const vector< string > * | getDescriptorNames ()
const Eigen::MatrixXd | getDescriptorTransformations ()
const Eigen::MatrixXd | getYTransformations ()
const Eigen::MatrixXd * | getY ()
void | setDescriptorIDs (const std::multiset< unsigned int > &sl)
const string * | getType ()
void | getUnnormalizedFeatureValue (int compound, int feature, double &return_value)
void | getUnnormalizedResponseValue (int compound, int response, double &return_value)

## Protected Attributes

Attributes
Eigen::MatrixXd | training_result_
Eigen::RowVectorXd | offsets_
int | default_no_opt_steps_
Eigen::MatrixXd | descriptor_matrix_
vector< string > | substance_names_
vector< string > | descriptor_names_
Eigen::MatrixXd | descriptor_transformations_
Eigen::MatrixXd | y_transformations_
Eigen::MatrixXd | Y_
String | type_
std::multiset< unsigned int > | descriptor_IDs_

## Accessors

RegressionValidation * | validation
const Eigen::MatrixXd * | getTrainingResult () const
virtual void | saveToFile (string filename)
virtual void | readFromFile (string filename)
void | show ()

## Input and Output. The following methods can be used to implement the functions saveToFile() and readFromFile() in final classes derived from this base-class

class | RegressionValidation
class | Rescoring
virtual void | calculateOffsets ()=0
void | readDescriptorInformationFromFile (std::ifstream &in, int no_descriptors, bool transformation, int no_coefficients)
void | saveDescriptorInformationToFile (std::ofstream &out)

## Additional Inherited Members

const QSARData * | data
Validation * | model_val
Protected Member Functions inherited from BALL::QSAR::Model
void | readMatrix (Eigen::MatrixXd &mat, std::ifstream &in, unsigned int lines, unsigned int col)
void | readVector (Eigen::RowVectorXd &vec, std::ifstream &in, unsigned int no_cells, bool column_vector)
void | readModelParametersFromFile (std::ifstream &in)
void | saveModelParametersToFile (std::ofstream &out)
virtual void | readDescriptorInformationFromFile (std::ifstream &in, int no_descriptors, bool transformation)
void | readResponseTransformationFromFile (std::ifstream &in, int no_y)
void | saveResponseTransformationToFile (std::ofstream &out)
Eigen::VectorXd | getSubstanceVector (const vector< double > &substance, bool transform)
Eigen::VectorXd | getSubstanceVector (const Eigen::VectorXd &substance, bool transform)
void | backTransformPrediction (Eigen::VectorXd &pred)
void | addLambda (Eigen::MatrixXd &matrix, double &lambda)
void | readDescriptorInformation ()

## Detailed Description

Definition at line 20 of file regressionModel.h.

## Constructor & Destructor Documentation

## RegressionModel()

BALL::QSAR::RegressionModel::RegressionModel | ( | const QSARData & | q | ) |

constructur,

Parameters

  q | QSAR-wrapper object, from which the data for this model should be taken

## ~RegressionModel()

BALL::QSAR::RegressionModel::~RegressionModel | ( |  | ) |

## Member Function Documentation

## calculateOffsets()

virtual void BALL::QSAR::RegressionModel::calculateOffsets | ( |  | ) |

protected pure virtual

Implemented in BALL::QSAR::KernelModel, BALL::QSAR::LinearModel, and BALL::QSAR::NonLinearModel.

## getTrainingResult()

const Eigen::MatrixXd * BALL::QSAR::RegressionModel::getTrainingResult | ( |  | ) | const

returns a const pointer to the matrix containing the coefficients obtained by Model.train()

## operator=()

virtual EIGEN_MAKE_ALIGNED_OPERATOR_NEW void BALL::QSAR::RegressionModel::operator= | ( | const RegressionModel & | m | ) |

virtual

## readDescriptorInformationFromFile()

void BALL::QSAR::RegressionModel::readDescriptorInformationFromFile | ( | std::ifstream & | in,
|  | int | no_descriptors,
|  | bool | transformation,
|  | int | no_coefficients )

protected

## readFromFile()

virtual void BALL::QSAR::RegressionModel::readFromFile | ( | string | filename | ) |

virtual

reconstruct a saved Model from a file

Implements BALL::QSAR::Model.

Reimplemented in BALL::QSAR::ALLModel, and BALL::QSAR::KernelModel.

## saveDescriptorInformationToFile()

void BALL::QSAR::RegressionModel::saveDescriptorInformationToFile | ( | std::ofstream & | out | ) |

protected virtual

overloaded by class RegressionModel, whose member function can also save coefficients and coefficient-errors

Reimplemented from BALL::QSAR::Model.

## saveToFile()

virtual void BALL::QSAR::RegressionModel::saveToFile | ( | string | filename | ) |

virtual

save Model to a file

Implements BALL::QSAR::Model.

Reimplemented in BALL::QSAR::ALLModel, and BALL::QSAR::KernelModel.

## show()

void BALL::QSAR::RegressionModel::show | ( |  | ) |

## Friends And Related Symbol Documentation

## RegressionValidation

friend class RegressionValidation

friend

Definition at line 84 of file regressionModel.h.

## Rescoring

friend class Rescoring

friend

Definition at line 85 of file regressionModel.h.

## Member Data Documentation

## offsets_

Eigen::RowVectorXd BALL::QSAR::RegressionModel::offsets_

protected

Definition at line 70 of file regressionModel.h.

## training_result_

Eigen::MatrixXd BALL::QSAR::RegressionModel::training_result_

protected

Eigen::MatrixXd containing the coefficients obtained by Model.train().
raining_result will have the following dimensions for the different types of models, with m=no of descriptors and c=no of modelled activities (=no of columns of Model.Y) :
LinearModel : mxc
KernelModel : nxc
ALLModel : mxc
FitModel : mxc
SVMModel : m x (c*no of classes)
SVRModel : m x (c*no of classes)

Definition at line 67 of file regressionModel.h.

## validation

RegressionValidation* BALL::QSAR::RegressionModel::validation

a ModelValidation object, that is used to validate this model and that will contain the results of the validations

Definition at line 42 of file regressionModel.h.