Registry / ai-ml / skrebate

skrebate

JSON →
library0.62pypypi✓ verified 84d ago

A scikit-learn-compatible implementation of Relief-based feature selection algorithms for classification and regression. Current version 0.62; development is infrequent (last release 2020).

pip install skrebate
INSTALL
IMPORT
SIG · SKREBATE
S
skrebate
ai-mlpythonv0.62
Install
10.7s avg
Import
3540ms
Disk
281MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.62 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
build_error
glibc
py 3.103.95 runs
installs and imports cleanly · install 10.7s · import 3.540s · 271MB
281MB installed
● package 281MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ReliefF
from skrebate import ReliefF
from skrebate import Relief
Old import path from pre-0.5 versions, raises ImportError
SURF
from skrebate import SURF
from skrebate.skmethods import SURF
Wrong submodule; direct import from skrebate is correct
MultiSURF
from skrebate import MultiSURF

Basic ReliefF feature selection on the Iris dataset

from skrebate import ReliefF from sklearn.datasets import load_iris from sklearn.model_selection import train_test_split X, y = load_iris(return_X_y=True) X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42) # Feature selection with ReliefF fs = ReliefF(n_neighbors=10, n_features_to_select=2) fs.fit(X_train, y_train) X_train_selected = fs.transform(X_train) X_test_selected = fs.transform(X_test) print(X_train_selected.shape)
Debug
Known issues
gotchaThe 'n_features_to_select' parameter is required and must be specified. If omitted, a warning is issued and no features are selected (transform returns empty array).
fix
Always pass n_features_to_select explicitly, even if you want all features (use n_features_to_select=X.shape[1]).
affects: all
gotchaReliefF and SURF algorithms expect continuous features. They do not handle categorical features natively; encoding (e.g., one-hot) is required.
fix
Apply one-hot encoding or label encoding before fitting. Note that one-hot may increase dimensionality and affect neighbor distances.
affects: all
deprecatedThe 'verbose' parameter in fit() is deprecated and may be removed in future versions.
fix
Remove verbose flag or set verbose=False.
affects: >=0.6
gotchaskrebate uses 'discrete_threshold' parameter for binarizing continuous features into discrete states for some algorithms. Incorrect setting can lead to poor feature rankings.
fix
Set discrete_threshold to the number of discrete values for categorical targets or leave as default (10).
affects: all
Errors
Common errors & fixes
ImportError: cannot import name 'ReliefF' from 'skrebate'
Attempted import from the wrong package or wrong spelling. Possibly confused with 'sklearn' or old version.
fix
Ensure you installed skrebate (pip install skrebate) and import from 'skrebate' (not 'sklearn' or 'scikit-rebate').
ModuleNotFoundError: No module named 'skrebate'
Package not installed or installed in a different environment.
fix
Run 'pip install skrebate'. If using Anaconda, try 'conda install -c conda-forge skrebate'.
ValueError: n_neighbors should be >= 1, got 0
Instantiating ReliefF with n_neighbors=0 or negative.
fix
Set n_neighbors to a positive integer (e.g., 10).
TypeError: fit() got an unexpected keyword argument 'verbose'
Using verbose parameter in newer versions where it was removed.
fix
Remove the verbose argument from fit().
Upgrade
Version history
0.62latest on PyPI · released Feb 15, 2021
Audit
Dependencies
numpyrequiredNumerical operations
scikit-learnrequiredBase estimator and transformer interface
scipyrequiredSparse matrix support
Agent activity
13 hits · last 30 days
node
10
OpenAI (training)
1
Resources
skrebate — pip install skrebate · libregistry