minisom
:red_circle: MiniSom is a minimalistic implementation of the Self Organizing Maps
Science Score: 46.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
✓Academic publication links
Links to: scholar.google -
✓Committers with academic emails
4 of 28 committers (14.3%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (16.7%) to scientific vocabulary
Keywords
Repository
:red_circle: MiniSom is a minimalistic implementation of the Self Organizing Maps
Basic Info
Statistics
- Stars: 1,524
- Watchers: 30
- Forks: 439
- Open Issues: 18
- Releases: 7
Topics
Metadata Files
Readme.md
MiniSom
Self Organizing Maps
MiniSom is a minimalistic and Numpy based implementation of the Self Organizing Maps (SOM). SOM is a type of Artificial Neural Network able to convert complex, nonlinear statistical relationships between high-dimensional data items into simple geometric relationships on a low-dimensional display. Minisom is designed to allow researchers to easily build on top of it and to give students the ability to quickly grasp its details.
The project initially aimed for a minimalistic implementation of the Self-Organizing Map (SOM) algorithm, focusing on simplicity in features, dependencies, and code style. Although it has expanded in terms of features, it remains minimalistic by relying only on the numpy library and emphasizing vectorization in coding style.
Updates about MiniSom are posted on X.
Jump into using MiniSom via Google Colab:
Installation
Just use pip:
pip install minisom
or download MiniSom to a directory of your choice and use the setup script:
git clone https://github.com/JustGlowing/minisom.git
python setup.py install
Note that the commands above will install the latest version of MiniSom which might contain changes that are not parte of the stable release.
How to use it
In order to use MiniSom you need your data organized as a Numpy matrix where each row corresponds to an observation or as list of lists like the following:
python
data = [[ 0.80, 0.55, 0.22, 0.03],
[ 0.82, 0.50, 0.23, 0.03],
[ 0.80, 0.54, 0.22, 0.03],
[ 0.80, 0.53, 0.26, 0.03],
[ 0.79, 0.56, 0.22, 0.03],
[ 0.75, 0.60, 0.25, 0.03],
[ 0.77, 0.59, 0.22, 0.03]]
Then you can train MiniSom just as follows:
python
from minisom import MiniSom
som = MiniSom(6, 6, 4, sigma=0.3, learning_rate=0.5) # initialization of 6x6 SOM
som.train(data, 100) # trains the SOM with 100 iterations
You can obtain the position of the winning neuron on the map for a given sample as follows:
som.winner(data[0])
For an overview of all the features implemented in minisom you can browse the following examples: https://github.com/JustGlowing/minisom/tree/master/examples
Export a SOM and load it again
A model can be saved using pickle as follows
```python import pickle som = MiniSom(7, 7, 4)
...train the som here
saving the som in the file som.p
with open('som.p', 'wb') as outfile: pickle.dump(som, outfile) ```
and can be loaded as follows
python
with open('som.p', 'rb') as infile:
som = pickle.load(infile)
Note that if a lambda function is used to define the decay factor MiniSom will not be pickable anymore.
Examples
Here are some of the charts you'll see how to generate in the examples:
| | |
:-------------------------:|:-------------------------:
Seeds map
| Class assignment
Handwritten digits mapping
| Hexagonal Topology
Color quantization
| Outliers detection 
Other tutorials
- Self Organizing Maps on the Glowing Python
- How to solve the Travelling Salesman Problem from the book Optimization Algorithms:Optimization Algorithms: AI techniques for design, planning, and control problems. Manning Publications, 2023.
- Lecture notes from the Machine Learning course at the University of Lisbon
- Introduction to Self-Organizing by Derrick Mwiti
- Self Organizing Maps on gapminder data [in German]
- Discovering SOM, an Unsupervised Neural Network by Gisely Alves
- Video tutorials made by the GeoEngineerings School: Part 1; Part 2; Part 3; Part 4
- Video tutorial Self Organizing Maps: Introduction by Art of Visualization
- Video tutorial Self Organizing Maps Hyperparameter tuning by SuperDataScience Machine Learning
How to cite MiniSom
@misc{vettigliminisom,
title={MiniSom: minimalistic and NumPy-based implementation of the Self Organizing Map},
author={Giuseppe Vettigli},
year={2018},
url={https://github.com/JustGlowing/minisom/},
}
MiniSom has been cited more than 400 times, check out the research where MiniSom was used here.
Guidelines to contribute
- In the description of your Pull Request explain clearly what it implements or fixes. In cases that the PR is about a code speedup, report a reproducible example and quantify the speedup.
- Give your pull request a helpful title that summarises what your contribution does.
- Write unit tests for your code and make sure the existing ones are up to date.
pytestcan be used for this:pytest minisom.py - Make sure that there are no stylistic issues using
pycodestyle:pycodestyle minisom.py - Make sure your code is properly commented and documented. Each public method needs to be documented as the existing ones.
Owner
- Name: Giuseppe Vettigli
- Login: JustGlowing
- Kind: user
- Location: Cambridge, UK
- Website: http://glowingpython.blogspot.com/
- Repositories: 15
- Profile: https://github.com/JustGlowing
Sr Data Scientist, teaching fellow, Python enthusiast, fearless visionarist, lateral thinker.
GitHub Events
Total
- Create event: 2
- Release event: 1
- Issues event: 16
- Watch event: 93
- Issue comment event: 30
- Push event: 7
- Pull request event: 2
- Fork event: 18
Last Year
- Create event: 2
- Release event: 1
- Issues event: 16
- Watch event: 93
- Issue comment event: 30
- Push event: 7
- Pull request event: 2
- Fork event: 18
Committers
Last synced: about 2 years ago
Top Committers
| Name | Commits | |
|---|---|---|
| Giuseppe Vettigli | g****i@h****m | 337 |
| justglowing | v****i@g****m | 68 |
| jriege | j****e@w****m | 14 |
| Birgit Jaekel | b****e | 8 |
| Evangelos Athanasakis | v****3@g****m | 6 |
| lbugnon | l****n@s****r | 6 |
| Tharinda Dilshan Piyadasa | t****7@g****m | 5 |
| Wei Zhang | z****e@m****m | 5 |
| avisionh | a****n@h****k | 4 |
| Flavio Giobergia | f****a@g****m | 3 |
| Peppe | a****i@a****) | 3 |
| Phan Hai Phong | h****2@g****m | 3 |
| giu | g****u@g****) | 3 |
| ben | b****n@h****m | 2 |
| christos.sourmpis | c****s@a****m | 2 |
| Adit Chawdhary | k****c | 2 |
| Fei Yao | 4****h | 2 |
| lazysperm | b****r@g****m | 1 |
| Tómas Árni Jónasson | m****l@t****e | 1 |
| Robert Jeffrey | 6****y | 1 |
| Shaurya Chanana | 1****a | 1 |
| Velibor Zeli | v****r@m****e | 1 |
| Sumera Priyadarsini | s****n@g****m | 1 |
| Matt Poegel | m****l@c****t | 1 |
| Mateusz Choinski | m****i@o****m | 1 |
| Joris Gillis | j****s@t****e | 1 |
| Dan Alberto Rosa De Jesús | d****s@p****v | 1 |
| Austin T | a****p@g****m | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 105
- Total pull requests: 33
- Average time to close issues: 27 days
- Average time to close pull requests: 15 days
- Total issue authors: 92
- Total pull request authors: 29
- Average comments per issue: 3.28
- Average comments per pull request: 3.12
- Merged pull requests: 16
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 10
- Pull requests: 3
- Average time to close issues: 6 days
- Average time to close pull requests: 1 day
- Issue authors: 10
- Pull request authors: 2
- Average comments per issue: 2.5
- Average comments per pull request: 1.33
- Merged pull requests: 1
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- mr-d3falt (4)
- mariajmolina (3)
- LorisAlif (3)
- aktaseren (2)
- Kheireddine-otm (2)
- SandroMartens (2)
- tomaszek0 (2)
- jiwon-j (2)
- bharathwajan (2)
- marifegitim (1)
- chanana (1)
- gabriel-OFV (1)
- VishnuRamD (1)
- aryamaan3 (1)
- michel039 (1)
Pull Request Authors
- JustGlowing (4)
- sachin-vs (2)
- rctorres (2)
- XiaoXiaoLeisure (2)
- mariajmolina (2)
- koloiyolo (1)
- jorisgillis (1)
- raresraf (1)
- bijae (1)
- BrandonGarciaWx (1)
- ricardomourarpm (1)
- avisionh (1)
- emeeubc (1)
- robertmkjeffrey (1)
- microprediction (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 2
-
Total downloads:
- pypi 28,106 last-month
-
Total dependent packages: 13
(may contain duplicates) -
Total dependent repositories: 19
(may contain duplicates) - Total versions: 9
- Total maintainers: 2
pypi.org: minisom
Minimalistic implementation of the Self Organizing Maps (SOM)
- Homepage: https://github.com/JustGlowing/minisom
- Documentation: https://minisom.readthedocs.io/
- License: MIT
-
Latest release: 2.3.5
published 12 months ago
Rankings
Maintainers (1)
spack.io: py-minisom
MiniSom is a minimalistic and Numpy based implementation of the Self Organizing Maps (SOM). SOM is a type of Artificial Neural Network able to convert complex, nonlinear statistical relationships between high- dimensional data items into simple geometric relationships on a low- dimensional display. Minisom is designed to allow researchers to easily build on top of it and to give students the ability to quickly grasp its details. The project initially aimed for a minimalistic implementation of the Self-Organizing Map (SOM) algorithm, focusing on simplicity in features, dependencies, and code style. Although it has expanded in terms of features, it remains minimalistic by relying only on the numpy library and emphasizing vectorization in coding style.
- Homepage: https://github.com/JustGlowing/minisom
- License: []
-
Latest release: 2.3.1
published about 2 years ago
Rankings
Maintainers (1)
Dependencies
- actions/checkout v3 composite
- actions/setup-python v3 composite
- actions/checkout v3 composite
- actions/setup-python v3 composite