Skip to content

Commit 73e2343

Browse files
author
Felix Riese
committed
Initial commit
0 parents  commit 73e2343

28 files changed

Lines changed: 3402 additions & 0 deletions

.gitignore

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
### Python ###
2+
# Byte-compiled / optimized / DLL files
3+
__pycache__/
4+
*.py[cod]
5+
*$py.class
6+
7+
# C extensions
8+
*.so
9+
10+
# Distribution / packaging
11+
.Python
12+
build/
13+
develop-eggs/
14+
dist/
15+
downloads/
16+
eggs/
17+
.eggs/
18+
lib/
19+
lib64/
20+
parts/
21+
sdist/
22+
var/
23+
wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
MANIFEST
28+
29+
# PyInstaller
30+
# Usually these files are written by a python script from a template
31+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
32+
*.manifest
33+
*.spec
34+
35+
# Installer logs
36+
pip-log.txt
37+
pip-delete-this-directory.txt
38+
39+
# Unit test / coverage reports
40+
htmlcov/
41+
.tox/
42+
.nox/
43+
.coverage
44+
.coverage.*
45+
.cache
46+
nosetests.xml
47+
coverage.xml
48+
*.cover
49+
.hypothesis/
50+
.pytest_cache/
51+
52+
# Translations
53+
*.mo
54+
*.pot
55+
56+
# Django stuff:
57+
*.log
58+
local_settings.py
59+
db.sqlite3
60+
61+
# Flask stuff:
62+
instance/
63+
.webassets-cache
64+
65+
# Scrapy stuff:
66+
.scrapy
67+
68+
# Sphinx documentation
69+
docs/_build/
70+
docs/_static/
71+
docs/_templates/
72+
73+
# PyBuilder
74+
target/
75+
76+
# Jupyter Notebook
77+
.ipynb_checkpoints
78+
79+
# IPython
80+
profile_default/
81+
ipython_config.py
82+
83+
# pyenv
84+
.python-version
85+
86+
# celery beat schedule file
87+
celerybeat-schedule
88+
89+
# SageMath parsed files
90+
*.sage.py
91+
92+
# Environments
93+
.env
94+
.venv
95+
env/
96+
venv/
97+
ENV/
98+
env.bak/
99+
venv.bak/
100+
101+
# Spyder project settings
102+
.spyderproject
103+
.spyproject
104+
105+
# Rope project settings
106+
.ropeproject
107+
108+
# mkdocs documentation
109+
/site
110+
111+
# mypy
112+
.mypy_cache/
113+
.dmypy.json
114+
dmypy.json
115+
116+
# Pyre type checker
117+
.pyre/
118+
119+
### Python Patch ###
120+
.venv/
121+
122+
### Python.VirtualEnv Stack ###
123+
# Virtualenv
124+
# http://iamzed.com/2009/05/07/a-primer-on-virtualenv/
125+
[Bb]in
126+
[Ii]nclude
127+
[Ll]ib
128+
[Ll]ib64
129+
[Ll]ocal
130+
[Ss]cripts
131+
pyvenv.cfg
132+
pip-selfcheck.json
133+
134+
# own:
135+
.DS_Store
136+
.vscode/
137+
*.pdf
138+
*.p
139+
*.mat

CHANGELOG.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Change Log
2+
==========
3+
4+
[1.0.0] - 2019-03-27
5+
- Initial release

LICENSE

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
BSD 3-Clause License
2+
3+
Copyright (c) 2019, Felix M. Riese
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted provided that the following conditions are met:
8+
9+
* Redistributions of source code must retain the above copyright notice, this
10+
list of conditions and the following disclaimer.
11+
12+
* Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
16+
* Neither the name of the copyright holder nor the names of its
17+
contributors may be used to endorse or promote products derived from
18+
this software without specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

MANIFEST.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
include README.rst
2+
include CHANGELOG.rst
3+
include LICENSE

README.rst

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
SUSI: SUpervised Self-organIzing maps in Python
2+
===============================================
3+
4+
Python package for unsupervised and supervised self-organizing maps (SOM)
5+
6+
Description
7+
-----------
8+
9+
We present the SUSI package for Python.
10+
It includes a fully functional SOM for unsupervised and supervised tasks.
11+
The class structure is set up as follows:
12+
13+
- SOMClustering: Unsupervised SOM for clustering
14+
15+
- SOMEstimator: Base class for supervised SOMs
16+
17+
- SOMRegressor: Regression SOM
18+
- SOMClassifier: Classification SOM
19+
20+
21+
:Paper:
22+
to be published
23+
24+
:License:
25+
`3-Clause BSD license <LICENSE>`_
26+
27+
:Authors:
28+
`Felix M. Riese <mailto:github@felixriese.de>`_,
29+
`Sina Keller <mailto:sina.keller@kit.edu>`_
30+
31+
:Citation: see `Citation`_ and in the `bibtex <bibliography.bib>`_ file
32+
33+
Installation
34+
------------
35+
36+
With PyPi:
37+
38+
.. code:: bash
39+
40+
pip3 install susi
41+
42+
43+
Manually:
44+
45+
.. code:: bash
46+
47+
git clone TODO
48+
cd susi/
49+
python setup.py install
50+
51+
**Dependencies**
52+
53+
Python 3 with:
54+
55+
* joblib
56+
* numpy
57+
* scikit-learn
58+
* scipy
59+
60+
Usage
61+
-----
62+
63+
Regression in python3:
64+
65+
.. code:: python3
66+
67+
import susi
68+
69+
som = susi.SOMRegressor()
70+
som.fit(X_train, y_train)
71+
print(som.score(X_test, y_test))
72+
73+
74+
Classification in `python3`:
75+
76+
.. code:: python3
77+
78+
import susi
79+
80+
som = susi.SOMClassifier()
81+
som.fit(X_train, y_train)
82+
print(som.score(X_test, y_test))
83+
84+
Code examples as Jupyter Notebooks:
85+
86+
* `examples/SOMRegressor_Hyperspectral <examples/SOMRegressor_Hyperspectral.ipynb>`_
87+
* `examples/SOMClassifier <examples/SOMClassifier.ipynb>`_
88+
* `examples/SOMClassifier_Salinas <examples/SOMClassifier_Salinas.ipynb>`_
89+
90+
Citation
91+
--------
92+
93+
The bibtex file including both references is available `here <bibliography.bib>`_.
94+
95+
**Paper:**
96+
97+
F. M. Riese and S. Keller, "SUSI: Supervised self-organizing maps for regression and classification in Python", 2019, Submitted to an ISPRS conference.
98+
99+
.. code:: bibtex
100+
101+
@article{riese2019susi,
102+
author = {Riese, Felix~M. and Keller, Sina},
103+
title = {SUSI: Supervised self-organizing maps for regression and classification in Python},
104+
year = {2019},
105+
notes = {Submitted to an ISPRS conference},
106+
TODO arxiv
107+
}
108+
109+
110+
**Code:**
111+
112+
F. M. Riese, "TODO", [DOI TODO](DOI TODO), 2019.
113+
114+
TODO Badge
115+
116+
.. code:: bibtex
117+
118+
@misc{riese2019cnn,
119+
author = {Riese, Felix~M.},
120+
title = {{TODO}},
121+
year = {2019},
122+
publisher = {Zenodo},
123+
DOI = {TODO},
124+
howpublished = {\href{TODO}{TODO}}
125+
}

bibliography.bib

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
@article{riese2019susi,
2+
author = {Riese, Felix~M. and Keller, Sina},
3+
title = {SUSI: Supervised self-organizing maps for classification and regression in Python},
4+
year = {2019},
5+
notes = {Submitted to an ISPRS conference},
6+
TODO arxiv
7+
}
8+
9+
@misc{riese2019cnn,
10+
author = {Riese, Felix~M.},
11+
title = {{TODO}},
12+
year = {2019},
13+
publisher = {Zenodo},
14+
DOI = {TODO},
15+
howpublished = {\href{TODO}{TODO}}
16+
}

docs/Makefile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line.
5+
SPHINXOPTS =
6+
SPHINXBUILD = sphinx-build
7+
SOURCEDIR = .
8+
BUILDDIR = _build
9+
10+
# Put it first so that "make" without argument is like "make help".
11+
help:
12+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
13+
14+
.PHONY: help Makefile
15+
16+
# Catch-all target: route all unknown targets to Sphinx using the new
17+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
18+
%: Makefile
19+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/SOMClassifier.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
SOMClassifier
2+
=============
3+
4+
.. automodule:: susi
5+
:members: SOMClassifier

docs/SOMClustering.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
SOMClustering
2+
=============
3+
4+
.. automodule:: susi
5+
:members: SOMClustering

docs/SOMEstimator.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
SOMEstimator
2+
============
3+
4+
.. automodule:: susi
5+
:members: SOMEstimator

0 commit comments

Comments
 (0)