MiniSom library wrapper for seamless integration with SciKit-learn library.
Project description
sklearn_minisom
MiniSom is Numpy based implementation of the Self Organizing Maps (SOM). SOM is a type of Artificial Neural Network able to convert complex, nonlinear statistical relationships between high-dimensional data items into simple geometric relationships on a low-dimensional display. Minisom is designed to allow researchers to easily build on top of it and to give students the ability to quickly grasp its details.
This is MiniSom library wrapper for seamless integration with SciKit-learn package.
Credits to:
-
Wrapped library: MiniSom by Giuseppe Vettigli
This wrapper aims to integrate MiniSOM library into SciKit-learn ecosystem. It enables easy integration with Scikit-learn pipelines and tools like GridSearchCV for hyperparameter optimization. It also provides easy, scikit-learn like API for developers to interact with while aiming to sustain high flexibility and capabilities of MiniSom library.
Example clustering datasets from Comparation of clustering algorithms on SciKit-learn
This is separate project and not part of MiniSom library due to creator's of the original project aim to keep their as lightweight as possible.
Table of content
Installation
Just use pip:
pip install sklearn_minisom
Dependencies:
- minisom>=2.3.3
- scikit-learn
- numpy
- scipy
- pytest
Examples
Just use it like any other scikit-learn cluster algorithm.
Let's start with importing required libraries and dataset.
from sklearn.datasets import load_wine
from sklearn_minisom import MiniSOM
from sklearn.preprocessing import StandardScaler
data = load_wine()
X = data.data
X = StandardScaler().fit_transform(X)
You can use fit and predict separately.
som = MiniSOM(3, 1, random_seed=40)
som.fit(X)
y = som.predict(X)
Or simply use convenient function.
som = MiniSOM(3, 1, random_seed=40)
y = som.fit_predict(X)
Alternatively you can also use SciKit-learn pipelines.
from sklearn.pipeline import Pipeline
pipeline = ([
('scaler', StandardScaler()),
('classifier', MiniSOM(3, 1, random_seed=40))
])
y = pipeline.fit_predict(X)
Now let's take a look at what we've got.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sklearn_minisom-0.0.2.tar.gz.
File metadata
- Download URL: sklearn_minisom-0.0.2.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
81df9c0453cd16414dca5a0b857cfaf9df39ddcd6161d6057da4b65d388f57cf
|
|
| MD5 |
58108ca9ceb5529525649de522686577
|
|
| BLAKE2b-256 |
f5938368c14d7c72a19dd1b757732111578a344f83cbf7f572a0020583c02af3
|
Provenance
The following attestation bundles were made for sklearn_minisom-0.0.2.tar.gz:
Publisher:
workflow.yml on koloiyolo/sklearn_minisom
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sklearn_minisom-0.0.2.tar.gz -
Subject digest:
81df9c0453cd16414dca5a0b857cfaf9df39ddcd6161d6057da4b65d388f57cf - Sigstore transparency entry: 157536797
- Sigstore integration time:
-
Permalink:
koloiyolo/sklearn_minisom@14ed0f89f27ebb7e6029a7dad4d72bcb44375b81 -
Branch / Tag:
refs/tags/0.0.2 - Owner: https://github.com/koloiyolo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@14ed0f89f27ebb7e6029a7dad4d72bcb44375b81 -
Trigger Event:
release
-
Statement type:
File details
Details for the file sklearn_minisom-0.0.2-py3-none-any.whl.
File metadata
- Download URL: sklearn_minisom-0.0.2-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e6e00a0b7b6d72e2176d844b98f53924704e7b1e2d90b538f3585c6d7801dc25
|
|
| MD5 |
5cd7f8e31d61f4f3789a9cf21776e568
|
|
| BLAKE2b-256 |
551c97f81c2efe6ec17adf92e6e2d93e4d514360a7116e6c4b593f7b6d81de08
|
Provenance
The following attestation bundles were made for sklearn_minisom-0.0.2-py3-none-any.whl:
Publisher:
workflow.yml on koloiyolo/sklearn_minisom
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sklearn_minisom-0.0.2-py3-none-any.whl -
Subject digest:
e6e00a0b7b6d72e2176d844b98f53924704e7b1e2d90b538f3585c6d7801dc25 - Sigstore transparency entry: 157536798
- Sigstore integration time:
-
Permalink:
koloiyolo/sklearn_minisom@14ed0f89f27ebb7e6029a7dad4d72bcb44375b81 -
Branch / Tag:
refs/tags/0.0.2 - Owner: https://github.com/koloiyolo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@14ed0f89f27ebb7e6029a7dad4d72bcb44375b81 -
Trigger Event:
release
-
Statement type: