Integrated path stability selection (IPSS)
Fast, flexible feature selection with false discovery control
Papers
-
Integrated path stability selection
Journal of the American Statistical Association • arXiv -
Nonparametric IPSS
Bioinformatics • arXiv
Installation
pip install ipss
Usage
from ipss import ipss
# load n-by-p feature matrix X and n-by-1 response vector y
# run ipss
ipss_output = ipss(X,y)
# select features based on target FDR
target_fdr = 0.1
q_values = ipss_output['q_values']
selected_features = [idx for idx, q_value in q_values.items() if q_value <= target_fdr]
print(f'Selected features (target FDR = {target_fdr}): {selected_features}')
Outputs
ipss_output = ipss(X,y) is a dictionary containing:
efp_scores: Dictionary whose keys are feature indices and values are their efp scores (dict of lengthp).q_values: Dictionary whose keys are feature indices and values are their q-values (dict of lengthp).runtime: Runtime of the algorithm in seconds (float).selected_features: Indices of selected features, iftarget_fdrortarget_fpis given (list of ints).stability_paths: Estimated selection probabilities (array of shape(k, p), withk <= n_alphas).
Selecting features
Each feature (column of X) is assigned:
- a q-value: the minimum false discovery rate (FDR) at which the feature is selected
- an efp score: the minimum expected number of false positives (E(FP)) at which the feature is selected
To select features:
- Control FDR by choosing all features with
q_value ≤ target_fdr
Example: Selecting features withq_value ≤ 0.1controls the FDR at level 0.1 - Control E(FP) by choosing all features with
efp_score ≤ target_fp
Example: Selecting features withefp_score ≤ 2controls the E(FP) at level 2
Main arguments
selector: Base algorithm (default'gb').'gb'(gradient boosting) and'rf'(random forest) capture nonlinear relationships;'l1'(lasso or l1 logistic regression) and'adaptive_lasso'capture linear ones. A custom function is also allowed (see below).selector_args: Arguments for the base algorithm (dict; defaultNone).n_jobs: Number of jobs to run in parallel (int; default1).
See ARGUMENTS.md for the full list of arguments.
Usage with custom feature importance scores
selector can also be a function that takes X, y, and the keyword arguments in selector_args, and returns one importance score per feature.
import numpy as np
from sklearn.linear_model import Ridge
from ipss import ipss
# custom feature importance function based on ridge regression
def ridge_selector(X, y, alpha):
return np.abs(Ridge(alpha=alpha).fit(X, y).coef_)
ipss_output = ipss(X, y, selector=ridge_selector, selector_args={'alpha': 1})
Examples
The examples folder includes analyses of
- Simulated data:
simple_example.py(Open in Google Colab). - Cancer data:
cancer.py(Open in Google Colab).
Metadata
Release files for ipss 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ipss-2.0.0.tar.gz | 29.9 kB | Without provenance | Details for ipss-2.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ipss-2.0.0-py3-none-any.whl | Python 3 | none | any | Details for ipss-2.0.0-py3-none-any.whl |
Total release size: 55.4 kB
Release files / ipss-2.0.0.tar.gz
| Download URL | ipss-2.0.0.tar.gz |
|---|---|
| Size | 29.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
24b11467d1d2fbeddb610e57048d5966ac07f957c0d2f6c6345a2675e88e4ca5
|
|
BLAKE2b-256 checksum How to use checksums |
75baa96f3dcdabc0a1dfb98583f2ecec35a736c0ec1dfab36a8ac13bff4a7bf1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Release files / ipss-2.0.0-py3-none-any.whl
| Download URL | ipss-2.0.0-py3-none-any.whl |
|---|---|
| Size | 25.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9a88e7661e76b6bd9c1854b5d476fa4b13e23be0f90c5b1eeeedf4532abf4ac8
|
|
BLAKE2b-256 checksum How to use checksums |
1453dbd2222494ccddd5853500828ffb0bc2412777898699d9fc07147fa77031
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Security for ipss 2.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.