BALL::QSAR::SNBModel Class Reference

#include <BALL/QSAR/snBModel.h>

Inheritance diagram for BALL::QSAR::SNBModel:
Inheritance graph
[legend]

List of all members.

Public Member Functions

Constructors and Destructors

 SNBModel (const QSARData &q)
 ~SNBModel ()
Accessors

void train ()
Vector< doublepredict (const vector< double > &substance, bool transform=1)
vector< doublegetParameters () const
void setParameters (vector< double > &v)
void saveToFile (string filename)
bool isTrained ()
void readFromFile (string filename)
vector< doublecalculateProbabilities (int activitiy_index, int feature_index, double feature_value)
int getNoResponseVariables ()

Attributes



vector< Matrix< double > > mean_
vector< Matrix< double > > stddev_
static const double sqrt2Pi_

Detailed Description

class for simple naive Bayes

Definition at line 42 of file snBModel.h.


Constructor & Destructor Documentation

BALL::QSAR::SNBModel::SNBModel ( const QSARData q  ) 
BALL::QSAR::SNBModel::~SNBModel (  ) 

Member Function Documentation

vector<double> BALL::QSAR::SNBModel::calculateProbabilities ( int  activitiy_index,
int  feature_index,
double  feature_value 
) [virtual]

calculate the probability for the specified feature to assume the given value for each class

Returns:
a probability for each class

Implements BALL::QSAR::BayesModel.

int BALL::QSAR::SNBModel::getNoResponseVariables (  )  [virtual]

returns the number of response variables for which this model has been trained

Implements BALL::QSAR::BayesModel.

vector<double> BALL::QSAR::SNBModel::getParameters (  )  const [virtual]

Reimplemented from BALL::QSAR::Model.

bool BALL::QSAR::SNBModel::isTrained (  )  [virtual]
Vector<double> BALL::QSAR::SNBModel::predict ( const vector< double > &  substance,
bool  transform = 1 
) [virtual]

Predicts the activities of a given substance

Parameters:
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.
Returns:
a RowVector containing one value for each predicted activity

Implements BALL::QSAR::Model.

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

reconstruct a saved Model from a file

Implements BALL::QSAR::Model.

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

save Model to a file

Implements BALL::QSAR::Model.

void BALL::QSAR::SNBModel::setParameters ( vector< double > &   )  [virtual]

sets the model parameters according to the given values.

Reimplemented from BALL::QSAR::Model.

void BALL::QSAR::SNBModel::train (  )  [virtual]

Starts training the model.

Implements BALL::QSAR::Model.


Member Data Documentation

vector<Matrix<double> > BALL::QSAR::SNBModel::mean_ [private]

vector containing one matrix for each modelled activity which holds the mean of each feature for each class

Definition at line 84 of file snBModel.h.

const double BALL::QSAR::SNBModel::sqrt2Pi_ [static, private]

Definition at line 89 of file snBModel.h.

vector<Matrix<double> > BALL::QSAR::SNBModel::stddev_ [private]

vector containing one matrix for each modelled activity which holds the standard deviation of each feature for each class

Definition at line 87 of file snBModel.h.

Generated by  doxygen 1.6.3