BALL  1.4.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Friends | List of all members
BALL::QSAR::RegressionModel Class Referenceabstract

#include <BALL/QSAR/regressionModel.h>

Inheritance diagram for BALL::QSAR::RegressionModel:
BALL::QSAR::Model BALL::QSAR::LinearModel BALL::QSAR::NonLinearModel BALL::QSAR::MLRModel BALL::QSAR::PCRModel BALL::QSAR::PLSModel BALL::QSAR::ALLModel BALL::QSAR::FitModel BALL::QSAR::KernelModel BALL::QSAR::RRModel BALL::QSAR::OPLSModel BALL::QSAR::KNNModel BALL::QSAR::GPModel BALL::QSAR::KPCRModel BALL::QSAR::KPLSModel BALL::QSAR::SVRModel BALL::QSAR::LibsvmModel

Public Member Functions

Constructors and Destructors
 RegressionModel (const QSARData &q)
 
 ~RegressionModel ()
 
virtual 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 Vector< doublepredict (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< doublegetParameters () const
 
std::multiset< unsigned int > * getDescriptorIDs ()
 
void setDataSource (const QSARData *q)
 
const Matrix< double > * getDescriptorMatrix ()
 
const vector< string > * getSubstanceNames ()
 
const vector< string > * getDescriptorNames ()
 
const Matrix< double > * 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 Member Functions

Input and Output. The following methods can be used to implement the functions saveToFile() and readFromFile() in final classes derived from this base-class
virtual void calculateOffsets ()=0
 
void readDescriptorInformationFromFile (std::ifstream &in, int no_descriptors, bool transformation, int no_coefficients)
 
void saveDescriptorInformationToFile (std::ofstream &out)
 
- Protected Member Functions inherited from BALL::QSAR::Model
void readMatrix (Matrix< double > &mat, std::ifstream &in, uint lines, uint col)
 
void readVector (Vector< double > &vec, std::ifstream &in, uint 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)
 
Vector< doublegetSubstanceVector (const vector< double > &substance, bool transform)
 
Vector< doublegetSubstanceVector (const Vector< double > &substance, bool transform)
 
void backTransformPrediction (Vector< double > &pred)
 
void addLambda (Matrix< double > &matrix, double &lambda)
 
void readDescriptorInformation ()
 

Protected Attributes

Attributes
BALL::Matrix< doubletraining_result_
 
Vector< doubleoffsets_
 
- Protected Attributes inherited from BALL::QSAR::Model
int default_no_opt_steps_
 
Matrix< doubledescriptor_matrix_
 
vector< string > substance_names_
 
vector< string > descriptor_names_
 
Matrix< doubledescriptor_transformations_
 
Matrix< doubley_transformations_
 
Matrix< doubleY_
 
String type_
 
std::multiset< unsigned int > descriptor_IDs_
 

Friends

class RegressionValidation
 

Accessors

RegressionValidationvalidation
 
const BALL::Matrix< double > * getTrainingResult () const
 
virtual void saveToFile (string filename)
 
virtual void readFromFile (string filename)
 
void show ()
 

Additional Inherited Members

- Public Attributes inherited from BALL::QSAR::Model
const QSARDatadata
 
Validationmodel_val
 

Detailed Description

Definition at line 43 of file regressionModel.h.

Constructor & Destructor Documentation

BALL::QSAR::RegressionModel::RegressionModel ( const QSARData q)
constructur,
Parameters
qQSAR-wrapper object, from which the data for this model should be taken
BALL::QSAR::RegressionModel::~RegressionModel ( )

Member Function Documentation

virtual void BALL::QSAR::RegressionModel::calculateOffsets ( )
protectedpure virtual
const BALL::Matrix<double>* BALL::QSAR::RegressionModel::getTrainingResult ( ) const

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

virtual void BALL::QSAR::RegressionModel::operator= ( const RegressionModel m)
virtual
void BALL::QSAR::RegressionModel::readDescriptorInformationFromFile ( std::ifstream &  in,
int  no_descriptors,
bool  transformation,
int  no_coefficients 
)
protected
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.

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

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

Reimplemented from BALL::QSAR::Model.

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.

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

Friends And Related Function Documentation

friend class RegressionValidation
friend

Definition at line 106 of file regressionModel.h.

Member Data Documentation

Vector<double> BALL::QSAR::RegressionModel::offsets_
protected

Definition at line 91 of file regressionModel.h.

BALL::Matrix<double> BALL::QSAR::RegressionModel::training_result_
protected
BALL::Matrix<double> containing the coefficients obtained by Model.train().\n

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 88 of file regressionModel.h.

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 63 of file regressionModel.h.