
Security News
New React Server Components Vulnerabilities: DoS and Source Code Exposure
New DoS and source code exposure bugs in React Server Components and Next.js: whatâs affected and how to update safely.
powershap
Advanced tools
powershap is a feature selection method that uses statistical hypothesis testing and power calculations on Shapley values, enabling fast and intuitive wrapper-based feature selection.
| pip | pip install powershap |
|---|
powershap is built to be intuitive, it supports various models including linear, tree-based, and even deep learning models for classification and regression tasks.
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) # Fit the PowerShap feature selector
selector.transform(X) # Reduce the dataset to the selected features
scikit-learn compatible._processed_shaps_df on a fitted PowerSHAP feature selector.Check out our benchmark results here.
Powershap is built on the core assumption that an informative feature will have a larger impact on the prediction compared to a known random feature.
The required number of iterations and the threshold values are hyperparameters of powershap. However, to avoid manually optimizing the hyperparameters powershap by default uses an automatic mode that automatically determines these hyperparameters.
If you use powershap in a scientific publication, we would highly appreciate citing us as:
@InProceedings{10.1007/978-3-031-26387-3_5,
author="Verhaeghe, Jarne
and Van Der Donckt, Jeroen
and Ongenae, Femke
and Van Hoecke, Sofie",
title="Powershap: A Power-Full Shapley Feature Selection Method",
booktitle="Machine Learning and Knowledge Discovery in Databases",
year="2023",
publisher="Springer International Publishing",
address="Cham",
pages="71--87",
isbn="978-3-031-26387-3"
}
Paper was presented at ECML PKDD 2022. The manuscript can be found here and on the github.
đ¤ Jarne Verhaeghe, Jeroen Van Der Donckt
This package is available under the MIT license. More information can be found here: https://github.com/predict-idlab/powershap/blob/main/LICENSE
FAQs
Feature selection using statistical significance of shap values
We found that powershap demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
New DoS and source code exposure bugs in React Server Components and Next.js: whatâs affected and how to update safely.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.

Security News
GitHub has revoked npm classic tokens for publishing; maintainers must migrate, but OpenJS warns OIDC trusted publishing still has risky gaps for critical projects.