skillfed

powershap

Feature selection using statistical significance of shap values

powershap v0.1.0.1 117.7K downloads/30d#12,151 on PyPI216
Permissive license MIT AGING released

What it is and what it does

Powershap is a feature selection method that combines Shapley value analysis with statistical hypothesis testing to identify which features are genuinely informative. It works by training multiple models on different data subsets, each time adding a random uniform feature as a baseline. For each feature, it calculates mean absolute Shapley values across iterations and compares them statistically to the random feature's impact using a percentile-based p-value test. Features with p-values below a threshold (default 0.01) are selected as significant.

The package includes an automatic mode that avoids manual hyperparameter tuning by using effect size and statistical power calculations to determine how many iterations are needed to achieve a target power level (default 0.99). It supports various model types—linear, tree-based, and deep learning—for both classification and regression, and integrates with scikit-learn conventions. The five runtime dependencies (catboost, pandas, scikit-learn, shap, statsmodels) are standard data science libraries.

Use it for:

  • Reduce dataset dimensionality before training a production model by identifying statistically significant predictive features.
  • Compare feature importance across different model types to find consensus on which features matter most.
  • Validate domain expertise by testing whether known important features rank above random noise in a statistical test.
  • Automate feature selection in pipelines without manual threshold tuning, using the automatic mode's power-based iteration scheduling.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Powershap performs feature selection by testing whether each feature's Shapley values are statistically significantly larger than a random feature's, using hypothesis testing and automatic power calculations to determine the required iterations.

Yes, with conditions. Powershap is a solid choice if you need statistically grounded feature selection and can tolerate aging maintenance (last update 323 days ago, no recent commits). The automatic mode removes hyperparameter tuning friction, and it integrates well with scikit-learn workflows. However, verify that its power-calculation defaults and statistical assumptions fit your problem domain before relying on it for critical feature selection decisions.

Install

powershap on PyPI

pip

pip install powershap

uv

uv add powershap

poetry

poetry add powershap

Installing powershap

Before you install

Low install friction with a pure Python wheel. Maintenance status is aging—last commit was 2025-10-07 and the package has not been updated in 323 days, though the repository remains active and not archived.

License in practice

MIT license permits commercial and private use with minimal restrictions, requiring only attribution and inclusion of the license text.

Quickstart

pip install powershap

from powershap import PowerShap
from catboost import CatBoostClassifier

X, y = ...  # your classification dataset
selector = PowerShap(model=CatBoostClassifier(n_estimators=250, verbose=0, use_best_model=True))
selector.fit(X, y)
X_selected = selector.transform(X)

Requires Python 3.9 or later (supports up to 3.13). Runtime dependencies include catboost, pandas, scikit-learn, shap, and statsmodels.

Verify before relying

  • Whether automatic mode's power requirement default of 0.99 and false positive probability of 0.01 are appropriate for typical use cases.
  • Performance and scalability characteristics on datasets with hundreds or thousands of features.
  • How the method handles imbalanced classification or regression with heavy-tailed distributions.

Package facts

License MIT (permissive)
Python support supports the current Python release (<=3.13,>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies 5 — catboost, pandas, scikit-learn, shap, statsmodels
Maintenance aging — 323 days since the last release
Last repo commit
First released
Downloads 117,711/month — #12,151 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: powershap-0.1.0.1-py3-none-any.whl

Keywords: data-science, feature selection, machine learning, shap

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: MacOS :: MacOS XOperating System :: Microsoft :: WindowsOperating System :: POSIX :: LinuxProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9

Tags

feature selection shapley valuesstatistical feature importancewrapper feature selectionshap-based feature rankingautomatic feature selection machine learning
feature-selectioninterpretabilitystatistical-testing

More Artificial Intelligence packages