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 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.1.tar.gz (28.1 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.1-py3-none-any.whl (27.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: popsom7-7.1.1.tar.gz
  • Upload date:
  • Size: 28.1 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.1.tar.gz
Algorithm Hash digest
SHA256 22fb4db6a7b47981514f0c36c55c281718066e4b0a15843edfcff29ea7f45c50
MD5 fb5bb4998b994f7f3b0cd8b033270b0a
BLAKE2b-256 0ce42fc15ebce6b579a192671235a4bba514ffe3eaba58dd6e3daaf808625670

See more details on using hashes here.

File details

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

File metadata

  • Download URL: popsom7-7.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1e23f91873826e8b56463db68c73e0909c2331d6077cc42a82199fd41d038a62
MD5 3fd4e0493832b3331c1c919c7820fc12
BLAKE2b-256 88557b40e1f608a9a9d0f08759bdde4b2a8892853099578b06fcb9329d948885

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