https://github.com/betatim/scikit-learn-phony-backend
https://github.com/betatim/scikit-learn-phony-backend
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/betatim/scikit-learn-phony-backend
- Owner: betatim
- Created: 2024-11-08T13:10:39.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-11-08T14:40:17.000Z (11 months ago)
- Last Synced: 2025-01-01T23:25:16.805Z (9 months ago)
- Language: Python
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Exploring scikit-learn backends
This repository is part of exploring how scikit-learn backends
could look like.This backend only implements (parts of) the `KMeans` estimator.
## Installing
To install this backend checkout the repository and run
```
pip install -e.
```## Using it
After installing the backend and the scikit-learn branch from
https://github.com/scikit-learn/scikit-learn/pull/30250```python
from sklearn.datasets import make_blobs
from sklearn.cluster import KMeansX, y = make_blobs(random_state=42)
# This won't get dispatched because this backend
# does not support the default `init` method.
km = KMeans(random_state=42)
km.fit(X, y)
assert km._backend is None# This will get dispatched because this backend
# supports `init="random"`.
km = KMeans(init="random", random_state=42)
km.fit(X, y)
assert km._backend is not None
```