Relevance, Redundancy, and Complementarity Trade-off, a robust feature selection algorithm
Project description
RRCT
Relevance, Redundancy, and Complementarity Trade-off, a robust feature selection algorithm (Python version).
This algorithm is a computationally efficient, robust approach for feature selection. The algorithm can be thought of as a natural extension to the popular mRMR feature selection algorithm, given that RRCT explicitly takes into account relevance and redundancy (like mRMR), and also introduces an additional third term to account for conditional relevance (also known as complementarity).
The RRCT algorithm is computationally very efficient and can run within a few seconds including on massive datasets with thousands of features. Moreover, it can serve as a useful 'off-the-shelf' feature selection algorithm because it generalizes well on both regression and classification problems, also without needing further adjusting for mixed-type variables.
R. Ibraheem is the author of this implementation and also maintains this package; this implementation is based on the earlier Python implementation by A. Tsanas (associated to below mentioned publication) that can be found in https://github.com/ThanasisTsanas/RRCT.
Class description
RRCTFeatureSelection(K=None)
- Parameter:
- K, non-zero positive integer to specify the number of selected features. Default value is K=None, which means all features will be selected.
- Attributes:
- selected_feature_indices_, an array of indices corresponding to the indices of selected features
- rrct_values_, a dictionary containing the relevance, redundancy, complementarity, and RRCT metrics of the selected features
- Methods:
- apply(X=X, y=y, verbose=0), apply the RRCT algorithm to a given training set X, y where X is an n by m numpy array of features, and y is an n by 1 numpy array of target values. verbose, a non-negative integer, controls the verbosity of output
- select(X=X), select features from a given design matrix X based on the results of the application of RRCT algorithm
- apply_select(X=X, y=y, verbose=0), apply RRCT algorithm to a given training set X, y and then select features from X.
Installation
pip install rrct
Example
# import the RRCT algorithm
from rrct.algorithm import RRCTFeatureSelection
# RRCT with K=20
selector = RRCTFeatureSelection(K=20)
# Apply RRCT to a training set X, y
selector.apply(X=X, y=y)
# Select features from X
X_selected = selector.select(X=X)
# Alternatively, apply_select can be called, which applies RRCT and select features from X
X_selected = selector.apply_select(X=X, y=y)
# Get the selected feature indices
selector.selected_feature_indices_
# Get the summary of the RRCT metrics
selector.rrct_values_
Reference
A. Tsanas: "Relevance, redundancy and complementarity trade-off (RRCT): a generic, efficient, robust feature selection tool", Patterns, Vol. 3:100471, 2022 https://doi.org/10.1016/j.patter.2022.100471
R. Ibraheem is a PhD student of EPSRC's MAC-MIGS Centre for Doctoral Training and he is hosted by the University of Edinburgh. MAC-MIGS is supported by the UK's Engineering and Physical Science Research Council (grant number EP/S023291/1). R. Ibraheem is supervised by Dr G. dos Reis. R. Ibraheem further contact points: LinkedIn, ORCID, GitHub.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file rrct-1.0.1.tar.gz
.
File metadata
- Download URL: rrct-1.0.1.tar.gz
- Upload date:
- Size: 16.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 61cee8060826fb83108995c15313872e48aad2533b55dc2871407ee55b887aa1 |
|
MD5 | 0e68aab13823518773704c518f6f078b |
|
BLAKE2b-256 | aaca40b24ecb312f8fedc6a25890a82048355c69685c45f56c3944c145a94f3f |
File details
Details for the file rrct-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: rrct-1.0.1-py3-none-any.whl
- Upload date:
- Size: 17.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d135373ac12de010703e6d5c63295e16bd43af2226c04d642069064602e285f8 |
|
MD5 | cd8bae99312da019e85a064ce6a138b4 |
|
BLAKE2b-256 | 9276126b3166b6d6f41bfb6c10c1fd8c17756df9352d1b444c9276b39fabfc64 |