{"id":24258,"library":"powershap","title":"powershap","description":"Powerful feature selection using statistical significance of SHAP values. Current version: 0.1.0.1. Active development, major releases every few months.","status":"active","version":"0.1.0.1","language":"python","source_language":"en","source_url":"https://github.com/predict-idlab/powershap","tags":["feature-selection","shap","statistical-significance","explainability"],"install":[{"cmd":"pip install powershap","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"","wrong":"","symbol":"PowerShap","correct":"from powershap import PowerShap"}],"quickstart":{"code":"from powershap import PowerShap\nfrom sklearn.datasets import make_classification\nfrom sklearn.ensemble import RandomForestClassifier\nimport pandas as pd\n\nX, y = make_classification(n_samples=100, n_features=20, random_state=42)\nX = pd.DataFrame(X, columns=[f'feature_{i}' for i in range(X.shape[1])])\n\nselector = PowerShap(\n    model=RandomForestClassifier(),\n    power_analysis='auto',       # automatic estimation\n    cv=5,\n    random_state=42\n)\nselector.fit(X, y)\nprint('Selected features:', selector.transform(X).columns.tolist())","lang":"python","description":"Quickstart: fit a PowerShap selector on a classification dataset and get selected features."},"warnings":[{"fix":"Use an estimator with .fit() and .predict() or .predict_proba() methods.","message":"The 'model' parameter can be a scikit-learn estimator or a pipeline. When using a pipeline, ensure the final step is an estimator.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Reduce the number of features or use a smaller sample size via the 'sample' parameter.","message":"PowerShap can be memory-intensive for high-dimensional data because it computes SHAP values for all features.","severity":"gotcha","affected_versions":"all"},{"fix":"Use power_analysis='auto' to avoid manual tuning.","message":"The 'power_analysis' parameter previously accepted 'power' or 'min_power'; now 'auto' is recommended as it estimates sample size automatically.","severity":"deprecated","affected_versions":"<0.1.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'pip install powershap' in the correct Python environment.","cause":"The package is not installed or installed in a different environment.","error":"ModuleNotFoundError: No module named 'powershap'"},{"fix":"Ensure you have version >=0.0.2 and use 'from powershap import PowerShap'.","cause":"The import path is wrong or the installed version is very old (pre-0.0.2).","error":"ImportError: cannot import name 'PowerShap' from 'powershap'"},{"fix":"Pass an unfitted estimator (e.g., RandomForestClassifier()) to PowerShap; it will be fitted internally.","cause":"The provided model is not an estimator or is not fitted.","error":"ValueError: The model must be a fitted estimator or a classifier/regressor."}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}