Skip to main content
# SOM
This is python implementation for Kohonen Self Organizing map using numpy and tensor

## Installtion

**Python 3**
`pip install somlib`

## Usage

1. Numpy implementation

```
from somlib import som
s = som.SOM(neurons=(5,5), dimentions=3, n_iter=500, learning_rate=0.1)
s.train(samples) # samples is a n x 3 matrix
print("Cluster centres:", s.weights_)
print("labels:", s.labels_)
result = s.predict(samples)
```

Here 5,5 is the dimention of neurons, 3 is the number of features. samples is numpy array with each sample a 3 dimentional vector

2. Tensor implementation

```
from somlib import som
s = SOM(neurons=(5,5), dimentions=3, n_iter=500, learning_rate=0.1, mode="tensor")
s.train(samples) # samples is a n x 3 matrix
print("Cluster centres:", s.weights_)
print("labels:", s.labels_)
result = s.predict(samples)
```

### Display clusters
To display clusters after training use this

```s.displayClusters(samples)```


![clusters](https://image.ibb.co/hS4uCH/figure_3.png "Clusters")

Metadata

Release files for somlib 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for somlib 0.0.4
File Size Uploaded
somlib-0.0.4.tar.gz 6.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for somlib 0.0.4
File Interpreter ABI Platform
somlib-0.0.4-py2-none-any.whl Python 2 none any Details

Total release size: 16.2 kB

Release files / somlib-0.0.4.tar.gz

Download URL somlib-0.0.4.tar.gz
Size 6.1 kB
Tags Source
SHA-256 checksum
How to use checksums
620ddbf1beb61e25725b66198cb50e59847401e55ea270dc346d030bffe6e117
BLAKE2b-256 checksum
How to use checksums
28c38d500699b256fda57c6ee2bee42cc34035fa30a71ed8b05e6fc9403fe9f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/2.7.12

Release files / somlib-0.0.4-py2-none-any.whl

Download URL somlib-0.0.4-py2-none-any.whl
Size 10.2 kB
Tags Python 2
SHA-256 checksum
How to use checksums
3dbeed2556138fc568a38a40a32ad755e4bbd877e09532ff91a5f2efd89d8094
BLAKE2b-256 checksum
How to use checksums
c463be68a94599eaa0fb880751b86607dc09cb31a4918d96b60ea47e71833427
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/2.7.12

Release history Release notifications | RSS feed

This release

0.0.4 This release

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page