Loading...
Searching...
No Matches
BALL::QSAR::FeatureSelection Class Reference

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

## Public Member Functions

Constructors and Destructors
| FeatureSelection (Model &m)
| FeatureSelection (KernelModel &m)
| ~FeatureSelection ()

## Accessors

void | setModel (Model &m)
void | setModel (KernelModel &km)
void | forwardSelection (int k=4, bool optPar=0)
void | backwardSelection (int k=4, bool optPar=0)
void | stepwiseSelection (int k=4, bool optPar=0)
void | twinScan (int k, bool optPar=0)
void | implicitSelection (LinearModel &lm, int act=1, double d=1)
void | removeHighlyCorrelatedFeatures (double &cor_threshold)
void | removeLowResponseCorrelation (double &min_correlation)
void | removeEmptyDescriptors ()
void | selectStat (int s)
void | setQualityIncreaseCutoff (double &d)

## Detailed Description

Definition at line 27 of file featureSelection.h.

## Constructor & Destructor Documentation

## FeatureSelection() [1/2]

BALL::QSAR::FeatureSelection::FeatureSelection | ( | Model & | m | ) |

## FeatureSelection() [2/2]

BALL::QSAR::FeatureSelection::FeatureSelection | ( | KernelModel & | m | ) |

## ~FeatureSelection()

BALL::QSAR::FeatureSelection::~FeatureSelection | ( |  | ) |

## Member Function Documentation

## backwardSelection()

void BALL::QSAR::FeatureSelection::backwardSelection | ( | int | k = 4,
|  | bool | optPar = 0 )

starts backward selection.
In order to evaluate how much a descriptor increases the accuracy of the model, cross-validation is started in each step using descriptor_matrix from class QSARData as data source.

Parameters

  optPar | 1 : Model.optimizeParameters() is used to try to find the optimal parameters during each step of feature selection. 0: Model.optimizeParameters() is not used during feature selection

## forwardSelection()

void BALL::QSAR::FeatureSelection::forwardSelection | ( | int | k = 4,
|  | bool | optPar = 0 )

starts forward selection.
In order to evaluate how much a descriptor increases the accuracy of the model, cross-validation is started in each step using descriptor_matrix from class QSARData as data source.

Parameters

  optPar | 1 : Model.optimizeParameters() is used to try to find the optimal parameters during each step of feature selection. 0: Model.optimizeParameters() is not used during feature selection

## implicitSelection()

void BALL::QSAR::FeatureSelection::implicitSelection | ( | LinearModel & | lm,
|  | int | act = 1,
|  | double | d = 1 )

uses the coefficients generated by a linear regression model (LinearModel.training_result) in order to select features.
All descriptors whose coefficients are within 0 +/- d*stddev are considered to be unimportant and are not selected.
Futhermore, if feature selection has already been done on FeatureSelection->model, only those descriptors that are already part of lm AND of FeatureSelection->model are tested.

Parameters

  act | determines which coefficients are to be used, i.e. which column of LinearModel.training_result

## removeEmptyDescriptors()

void BALL::QSAR::FeatureSelection::removeEmptyDescriptors | ( |  | ) |

removes descriptors whose values are 0 in all substances from the list of selected features

## removeHighlyCorrelatedFeatures()

void BALL::QSAR::FeatureSelection::removeHighlyCorrelatedFeatures | ( | double & | cor_threshold | ) |

reomves features that are highly correlated to another feature.

Parameters

  cor_threshold | all feature which a correlation (to another feature) > cor_threshold or < cor_threshold are removed

## removeLowResponseCorrelation()

void BALL::QSAR::FeatureSelection::removeLowResponseCorrelation | ( | double & | min_correlation | ) |

removes those features that do not have a correlation greater than the specified value to any of the response variables

## selectStat()

void BALL::QSAR::FeatureSelection::selectStat | ( | int | s | ) |

## setModel() [1/2]

void BALL::QSAR::FeatureSelection::setModel | ( | KernelModel & | km | ) |

## setModel() [2/2]

void BALL::QSAR::FeatureSelection::setModel | ( | Model & | m | ) |

set the model, or which feature selection is to be done

## setQualityIncreaseCutoff()

void BALL::QSAR::FeatureSelection::setQualityIncreaseCutoff | ( | double & | d | ) |

Sets a cutoff value for feature selections.
If the preditive quality is increased by less than d after adding/removing a descriptor, feature selection is stopped.

## stepwiseSelection()

void BALL::QSAR::FeatureSelection::stepwiseSelection | ( | int | k = 4,
|  | bool | optPar = 0 )

## twinScan()

void BALL::QSAR::FeatureSelection::twinScan | ( | int | k,
|  | bool | optPar = 0 )

Does a simple check consisting of two successive scans of all features.
In the first scan, the best feature to start with is searched.
In the second scan, it is checked for each remaining (non-empty) descriptor whether it can increase the prediction quality. The features are tested in the descending order of their predictive qualities as determined in the first scan.
Thus, this method is particularly suited for models that consider all features to be independent for each other (e.g. Bayesian classifiaction models).