Registry / ai-ml / scikit-learn-extra

scikit-learn-extra

JSON →
library0.3.0pypypiunverified

A set of additional estimators and tools for scikit-learn, including K-Medoids, EigenPro, and Fastfood. Current version: 0.3.0 (released Oct 2021). Releases are infrequent; the project is in maintenance mode.

pip install scikit-learn-extra
INSTALL
IMPORT
SIG · SCIKIT-LEARN-EXTRA
S
scikit-learn-extra
ai-mlpythonv0.3.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

KMedoids
from sklearn_extra.cluster import KMedoids
from sklearn.cluster import KMedoids
KMedoids is not in scikit-learn core; it was removed from sklearn_extra after version 0.2.0?
EigenPro
from sklearn_extra.kernel_approximation import EigenPro
Fastfood
from sklearn_extra.kernel_approximation import Fastfood

Fit K-Medoids clustering on a small dataset and print cluster labels.

from sklearn_extra.cluster import KMedoids import numpy as np X = np.array([[1, 2], [1, 4], [1, 0], [4, 2], [4, 4], [4, 0]]) kmedoids = KMedoids(n_clusters=2, random_state=0).fit(X) print(kmedoids.labels_)
Debug
Known issues
gotchaKMedoids was originally in sklearn_extra.cluster; ensure you import from sklearn_extra, not sklearn.
fix
Use 'from sklearn_extra.cluster import KMedoids'.
affects: all
gotchaThe library may not be actively maintained; check for compatibility with newer scikit-learn versions (>=1.0).
fix
Pin scikit-learn version to <=1.0.2 if issues arise, or consider alternatives like sklearn.cluster.KMeans.
affects: 0.3.0
deprecatedKernel approximation estimators (EigenPro, Fastfood) may behave differently or be removed in future versions.
fix
Use scikit-learn's RBFSampler as a more stable alternative.
affects: 0.3.0
Upgrade
Version history
0.3.0latest on PyPI · released Mar 27, 2023
Audit
Dependencies
scikit-learnrequiredRequired. The library extends scikit-learn and depends on it.
Agent activity
7 hits · last 30 days
node
6
OpenAI (training)
1
Resources
scikit-learn-extra — pip install scikit-learn-extra · libregistry