BALL  1.4.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Private Attributes | List of all members
BALL::QSAR::KNNModel Class Reference

#include <BALL/QSAR/knnModel.h>

Inheritance diagram for BALL::QSAR::KNNModel:
BALL::QSAR::ALLModel BALL::QSAR::NonLinearModel BALL::QSAR::RegressionModel BALL::QSAR::Model

Public Member Functions

void calculateWeights (Matrix< double > &dist, Vector< double > &w)
void setParameters (vector< double > &v)
vector< doublegetParameters () const
bool optimizeParameters (int k, int no_steps)
Constructors and Destructors
 KNNModel (const QSARData &q, int k=3)
- Public Member Functions inherited from BALL::QSAR::ALLModel
 ALLModel (const QSARData &q, double kw=4)
 ~ALLModel ()
void setKw (double kw)
virtual Vector< doublepredict (const vector< double > &substance, bool transform=1)
void train ()
double getKw ()
void saveToFile (string filename)
void readFromFile (string filename)
- Public Member Functions inherited from BALL::QSAR::NonLinearModel
 NonLinearModel (const QSARData &q)
 ~NonLinearModel ()

Private Attributes

int k_

Additional Inherited Members

- Public Attributes inherited from BALL::QSAR::RegressionModel
RegressionValidationvalidation
- Public Attributes inherited from BALL::QSAR::Model
const QSARDatadata
Validationmodel_val
- Protected Member Functions inherited from BALL::QSAR::ALLModel
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)
- Protected Member Functions inherited from BALL::QSAR::NonLinearModel
virtual void calculateOffsets ()
- Protected Member Functions inherited from BALL::QSAR::RegressionModel
void readDescriptorInformationFromFile (std::ifstream &in, int no_descriptors, bool transformation, int no_coefficients)
void saveDescriptorInformationToFile (std::ofstream &out)
- Protected Attributes inherited from BALL::QSAR::ALLModel
double kw_
double lambda_

Detailed Description

class for automated lazy learning (ALL-QSAR)

Definition at line 39 of file knnModel.h.

Constructor & Destructor Documentation

BALL::QSAR::KNNModel::KNNModel ( const QSARData q,
int  k = 3 
)

Member Function Documentation

void BALL::QSAR::KNNModel::calculateWeights ( Matrix< double > &  dist,
Vector< double > &  w 
)
vector<double> BALL::QSAR::KNNModel::getParameters ( ) const
virtual

Reimplemented from BALL::QSAR::ALLModel.

bool BALL::QSAR::KNNModel::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::ALLModel.

void BALL::QSAR::KNNModel::setParameters ( vector< double > &  )
virtual

sets the model parameters according to the given values.

Reimplemented from BALL::QSAR::ALLModel.

Member Data Documentation

int BALL::QSAR::KNNModel::k_
private

Definition at line 57 of file knnModel.h.