Skip to main content

gsom clustering and dimensional reduction algorithm

Project description

pygsom - python GSOM algorithm

pygsom is an open source python-based implementation of GSOM algorithm. GSOM is unsupervised dimensionality reduction and clustering algorithm

Table of Contents

Installation

To pip install pygsom from github:

pip install pygsom

pygsom supports Python 3.6+.

Minimal example

import numpy as np
import pandas as pd
import gsom

data_filename = "data/zoo.txt".replace('\\', '/')


if __name__ == '__main__':
    np.random.seed(1)
    df = pd.read_csv(data_filename)
    print(df.shape)
    data_training = df.iloc[:, 1:17]
    gsom_map = gsom.GSOM(.83, 16, max_radius=4)
    gsom_map.fit(data_training.to_numpy(), 100, 50)
    map_points = gsom_map.predict(df,"Name","label")
    gsom.plot(map_points, "Name", gsom_map=gsom_map)
    map_points.to_csv("gsom.csv", index=False)

Getting started

Train the GSOM algorithm : need to give input data in numpy array with training iterations and smoothing iterations

gsom_map.fit(data_training.to_numpy(), <training iterations>, <smooth iterations>)

Predict cluster nodes : need to give input data in pandas dataframe with names and labels

map_points = gsom_map.predict(df,<name column name>,<label column name>)

Plot the 2D map: need to give the output of predict function with label column (name column or label column)

gsom.plot(map_points, <name column name/label column name>, gsom_map=<gsom_map>)

Citing pygsom

If you use pygsom, please cite the following paper:

@article{alahakoon2000dynamic,
  title={Dynamic self-organizing maps with controlled growth for knowledge discovery},
  author={Alahakoon, Damminda and Halgamuge, Saman K and Srinivasan, Bala},
  journal={IEEE Transactions on neural networks},
  volume={11},
  number={3},
  pages={601--614},
  year={2000},
  publisher={IEEE}
}

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

pygsom-0.1.0.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

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

pygsom-0.1.0-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file pygsom-0.1.0.tar.gz.

File metadata

  • Download URL: pygsom-0.1.0.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for pygsom-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d16a2503fe7d7c6b541709110099f16ea9c18578788243c8184848045d54ea5d
MD5 a8b69ead4fe4adf0b81db65f7a784053
BLAKE2b-256 629822aa1c37e3d8d862c225cdefbd51ae3d1e25e092fee2cef4eed6c3a362af

See more details on using hashes here.

File details

Details for the file pygsom-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pygsom-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for pygsom-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3617c34531c4339ac5eeac33517f2721ee55178e27c96f9248a857035bad89c5
MD5 7bc936ba578ae3ab8ea58634f47304b8
BLAKE2b-256 393ed11606e05cc0c38bdccbc31f6122da366bf4d1e57cffc24482f2c2c7aced

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