Popsom7
Overview
A fast, user-friendly implementation of self-organizing maps (SOMs) with a number of distinguishing features:
-
Support for both Python and R.
-
Easy to use interfaces for building and evaluating self-organizing maps:
- An interface that works the same on both the R and the Python platforms
- An interface that is sklearn compatible, allowing you to leverage the power and convenience of the sklearn framework in Python.
-
Automatic centroid detection and visualization using starbursts.
-
Two models of the data: (a) a self organizing map model, (b) a centroid based clustering model.
-
A number of easily accessible quality metrics.
-
An implementation of the training algorithm based on tensor algebra.
Installation
You can install popsom7 via pip:
pip install popsom7
Usage
Below is a quick example using the popsom sklearnapi interface.
from popsom7.sklearnapi import SOM
import pandas as pd
from sklearn import datasets
iris = datasets.load_iris()
X = pd.DataFrame(iris.data, columns=iris.feature_names)
y = pd.DataFrame(iris.target_names[iris.target],columns=['species'])
# Create and fit the SOM model
som = SOM(xdim=20, ydim=15, train=100000, seed=42).fit(X, y)
# View a summary of the SOM
som.summary()
# Display the starburst (heat map) representation
som.starburst()
Here is the same example written in the API based on the R API.
from popsom7.maputils import map_build, map_summary, map_starburst
import pandas as pd
from sklearn import datasets
iris = datasets.load_iris()
X = pd.DataFrame(iris.data, columns=iris.feature_names)
y = pd.DataFrame(iris.target_names[iris.target],columns=['species'])
# Build the map
som_map = map_build(X, labels=y, xdim=20, ydim=15, train=100000, seed=42)
# View a summary of the SOM
map_summary(som_map)
# Display the starburst (heat map) representation
map_starburst(som_map)
For more details please see the project homepage
Metadata
Release files for popsom7 7.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| popsom7-7.1.2.tar.gz | 28.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| popsom7-7.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 55.2 kB
Release files / popsom7-7.1.2.tar.gz
| Download URL | popsom7-7.1.2.tar.gz |
|---|---|
| Size | 28.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a85f2b21901fe7b92d3f45c99c12a8eb6a6f06ac4531b043b1c38546c68137fe
|
|
BLAKE2b-256 checksum How to use checksums |
163e6794ae772c012eb8b99a6c38497b2988383aa200b061f80decaa2f0c89bc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.1
|
Release files / popsom7-7.1.2-py3-none-any.whl
| Download URL | popsom7-7.1.2-py3-none-any.whl |
|---|---|
| Size | 27.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b9e47e3b37261ad5e5d744185a262af9c9c013b789786a2c04deaaf4bd0efaf1
|
|
BLAKE2b-256 checksum How to use checksums |
2652fb229bbef92f5fb382c9b452ebf4c374bcd8243265904c3528c8e5533ee4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.1
|