Skip to main content

A Fast, User-friendly Implementation of Self-Organizing Maps (SOMs)

Project description

Popsom7

Overview

A fast, user-friendly implementation of self-organizing maps (SOMs) with a number of distinguishing features:

  1. Support for both Python and R.

  2. 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.
  3. Automatic centroid detection and visualization using starbursts.

  4. Two models of the data: (a) a self organizing map model, (b) a centroid based clustering model.

  5. A number of easily accessible quality metrics.

  6. 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

popsom7-7.1.2.tar.gz (28.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

popsom7-7.1.2-py3-none-any.whl (27.0 kB view details)

Uploaded Python 3

File details

Details for the file popsom7-7.1.2.tar.gz.

File metadata

  • Download URL: popsom7-7.1.2.tar.gz
  • Upload date:
  • Size: 28.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for popsom7-7.1.2.tar.gz
Algorithm Hash digest
SHA256 a85f2b21901fe7b92d3f45c99c12a8eb6a6f06ac4531b043b1c38546c68137fe
MD5 754c1e735d46aad22c82fee65cb4b459
BLAKE2b-256 163e6794ae772c012eb8b99a6c38497b2988383aa200b061f80decaa2f0c89bc

See more details on using hashes here.

File details

Details for the file popsom7-7.1.2-py3-none-any.whl.

File metadata

  • Download URL: popsom7-7.1.2-py3-none-any.whl
  • Upload date:
  • Size: 27.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for popsom7-7.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b9e47e3b37261ad5e5d744185a262af9c9c013b789786a2c04deaaf4bd0efaf1
MD5 7cd9d2ea57e9a14e5ad8e84284589f83
BLAKE2b-256 2652fb229bbef92f5fb382c9b452ebf4c374bcd8243265904c3528c8e5533ee4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page