Skip to main content

Triglav - Feature Selection Using Iterative Refinement

CI

Overview

Triglav (named after the Slavic god of divination) attempts to discover all relevant features using an iterative refinement approach. This approach is based after the method introduced in Boruta with several modifications:

  1. Features are clustered and the impact of each cluster is assessed as the average of the Shapley scores of the features associated with each cluster.

  2. Like Boruta, a set of shadow features is created. However, an ensemble of classifiers is used to measure the Shapley scores of each real feature and its shadow counterpart, producing a distribution of scores. A Wilcoxon signed-rank test is used to determine the significance of each cluster and p-values are adjusted to correct for multiple comparisons across each round. Clusters with adjusted p-values below 'alpha' are considered a hit.

  3. At each iteration at or over 'n_iter_fwer', two beta-binomial distributions are used to determine if a cluster should be retained or not. The first distribution models the hit rate while the the second distribution models the rejection rate. For a cluster to be successfully selected the probability of a hit must be significant after correcting for multiple comparisons and applying a Bonferroni correction for each iteration greater than or equal to the 'n_iter_fwer' parameter. For a cluster to be rejected a similar round of reasoning applies. Clusters that are not rejected remain tentative.

  4. After the iterative refinement stage SAGE scores could be used to select the best feature from each cluster.

While this method may not produce all features important for classification, it does have some nice properties. First of all, by using an Extremely Randomized Trees model as the default, dependencies between features can be accounted for. Further, decision tree models are better able to partition the sample space. This can result in the selection of both globally optimal and locally optimal features. Finally, this approach identifies stable clusters of features since only those which consistently pass the Wilcoxon signed-rank test are selected. This makes this approach more robust to differences in training data.

Install

With Conda from BioConda:

conda install -c bioconda triglav

From PyPI:

pip install triglav

From source:

git clone https://github.com/jrudar/Triglav.git
cd Triglav
pip install .
# or create a virtual environment
python -m venv venv
source venv/bin/activate
pip install .

Interface

An overview of the API can be found here.

Usage and Examples

Examples of how to use Triglav can be found here.

Contributing

To contribute to the development of Triglav please read our contributing guide

References

Coming Soon

Metadata

Release files for triglav 1.0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for triglav 1.0.7
File Size Uploaded
triglav-1.0.7.tar.gz 1.3 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for triglav 1.0.7
File Interpreter ABI Platform
triglav-1.0.7-py3-none-any.whl Python 3 none any Details

Total release size: 1.3 MB

Release files / triglav-1.0.7.tar.gz

Download URL triglav-1.0.7.tar.gz
Size 1.3 MB
Tags Source
SHA-256 checksum
How to use checksums
4d0b12a5eae2a80c7c816aabe11409c6d1cc7f0f6051e33af87b345c8a7fe340
BLAKE2b-256 checksum
How to use checksums
8d04ab8f17d720f60c13121113769b4fe3361b308596af78d9bdc420c88cfaef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.9.19

Release files / triglav-1.0.7-py3-none-any.whl

Download URL triglav-1.0.7-py3-none-any.whl
Size 13.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cc95a1d81b677b8c27a8ebb7cc92022c453ce8e354c3a091c7f9ceb3696b4677
BLAKE2b-256 checksum
How to use checksums
700b9ef376f8a39f95a48971ee20ee8cc8805c6c82f74115b37134871736b3fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.9.19

Release history Release notifications | RSS feed

This release

1.0.7 This release

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page