Skip to main content

Integrated path stability selection (IPSS)

Fast, flexible feature selection with false discovery control

Papers

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 length p).
  • q_values: Dictionary whose keys are feature indices and values are their q-values (dict of length p).
  • runtime: Runtime of the algorithm in seconds (float).
  • selected_features: Indices of selected features, if target_fdr or target_fp is given (list of ints).
  • stability_paths: Estimated selection probabilities (array of shape (k, p), with k <= 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 with q_value ≤ 0.1 controls the FDR at level 0.1
  • Control E(FP) by choosing all features with efp_score ≤ target_fp
    Example: Selecting features with efp_score ≤ 2 controls 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; default None).
  • n_jobs: Number of jobs to run in parallel (int; default 1).

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

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)

Source distribution for ipss 2.0.0
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)

Table of built distributions (wheels) for ipss 2.0.0
File Interpreter ABI Platform Actions
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.

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files No provenance

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