Skip to content
Snippets Groups Projects
Commit e4469b9b authored by Adam Fekete's avatar Adam Fekete
Browse files

refactoring

parent a5d60c8a
No related branches found
No related tags found
No related merge requests found
Pipeline #197204 passed
## Python: https://github.com/github/gitignore/blob/main/Python.gitignore
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
.pybuilder/
target/
# Jupyter Notebook
.ipynb_checkpoints
# IPython
profile_default/
ipython_config.py
# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version
# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock
# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock
# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/
# Celery stuff
celerybeat-schedule
celerybeat.pid
# SageMath parsed files
*.sage.py
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
.dmypy.json
dmypy.json
# Pyre type checker
.pyre/
# pytype static type analyzer
.pytype/
# Cython debug symbols
cython_debug/
# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
\ No newline at end of file
build:
stage: build
tags:
- docker-builder
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
variables:
IMAGE_TAG: ${CI_COMMIT_REF_SLUG}
GIT_SUBMODULE_STRATEGY: recursive
GIT_SUBMODULE_DEPTH: 1
GIT_SUBMODULE_UPDATE_FLAGS: --jobs 4
before_script:
- echo "{\"auths\":{\"${CI_REGISTRY}\":{\"auth\":\"$(printf "%s:%s" "${CI_REGISTRY_USER}" "${CI_REGISTRY_PASSWORD}" | base64 | tr -d '\n')\"},\"$CI_DEPENDENCY_PROXY_SERVER\":{\"auth\":\"$(printf "%s:%s" ${CI_DEPENDENCY_PROXY_USER} "${CI_DEPENDENCY_PROXY_PASSWORD}" | base64 | tr -d '\n')\"}}}" > /kaniko/.docker/config.json
script:
- /kaniko/executor
--context "${CI_PROJECT_DIR}"
--dockerfile "${CI_PROJECT_DIR}/Dockerfile"
--destination "${CI_REGISTRY_IMAGE}:${IMAGE_TAG}"
ARG BUILDER_BASE_IMAGE=jupyter/scipy-notebook:python-3.9
FROM $BUILDER_BASE_IMAGE as builder
# ================================================================================
# Linux applications and libraries
# ================================================================================
# USER root
#
# RUN apt-get update \
# && apt-get install --yes --quiet --no-install-recommends \
# graphviz \
# && apt-get clean \
# && rm -rf /var/lib/apt/lists/*
# ================================================================================
# Install all needed Python Packages
# ================================================================================
USER ${NB_UID}
# Install from the requirements.txt file
COPY --chown=${NB_UID}:${NB_GID} requirements.in /tmp/
RUN pip install --no-cache-dir --requirement /tmp/requirements.in \
&& fix-permissions "${CONDA_DIR}" \
&& fix-permissions "/home/${NB_USER}"
# ================================================================================
# Setup the user
# ================================================================================
USER ${NB_UID}
WORKDIR "${HOME}"
COPY --chown=${NB_UID}:${NB_GID} assets/ assets/
COPY --chown=${NB_UID}:${NB_GID} clustering_tutorial.ipynb .
# tutorial-clustering-tutorial
In this tutorial, we introduce to the most popular clustering algorithms. We focus on partitioning, hierarchical and density-based clustering algorithms. The methods are tested on synthetic datasets of increasing complexity
## Development
Cloning the source code:
```
git clone git@gitlab.mpcdf.mpg.de:nomad-lab/ai-toolkit/tutorial-clustering-tutorial.git
cd tutorial-clustering-tutorial
git checkout updates # use a special branch
```
Running notebook image and mounting local folder into teh work directory:
```
docker run --rm -it -e DOCKER_STACKS_JUPYTER_CMD=notebook -p 8888:8888 -v $PWD:/home/jovyan/work gitlab-registry.mpcdf.mpg.de/nomad-lab/ai-toolkit/tutorial-clustering-tutorial:updates
```
Building the image (advanced):
```
docker build --pull --rm -f "Dockerfile" -t gitlab-registry.mpcdf.mpg.de/nomad-lab/ai-toolkit/tutorial-clustering-tutorial:updates "."
```
Running container with sudo feature (advanced):
```
docker run --rm -it --user root -e GRANT_SUDO=yes -e DOCKER_STACKS_JUPYTER_CMD=notebook -p 8888:8888 -v $PWD:/home/jovyan/work gitlab-registry.mpcdf.mpg.de/nomad-lab/ai-toolkit/tutorial-clustering-tutorial:updates
```
assets/clustering_tutorial/Logo_MPG.png

176 KiB

assets/clustering_tutorial/Logo_NOMAD.png

303 KiB

assets/clustering_tutorial/logo_HU.png

449 KiB

assets/clustering_tutorial/logo_MPG.png

176 KiB

assets/clustering_tutorial/logo_NOMAD.png

303 KiB

This diff is collapsed.
This diff is collapsed.
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 27.5.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 2500 560" style="enable-background:new 0 0 2500 560;" xml:space="preserve">
<style type="text/css">
.st0{fill:#192E86;stroke:#192E86;stroke-width:38.9717;stroke-miterlimit:10;}
.st1{fill:#2A4CDF;stroke:#2A4CDF;stroke-width:38.9717;stroke-miterlimit:10;}
.st2{fill:#2A4CDF;}
</style>
<g>
<path class="st0" d="M359.7,240.2c43.5,0,78.7-35.2,78.7-78.7c0-43.5-35.2-78.7-78.7-78.7c-43.5,0-78.7,35.2-78.7,78.7
C281,205,316.3,240.2,359.7,240.2z"/>
<path class="st1" d="M415.5,330.3c-30.8-30.8-80.7-30.8-111.5,0c-28.8,28.8-74.4,30.8-105.6,5.5c-1.9-2.3-3.9-4.7-5.8-6.6
c-30.8-30.8-30.8-80.7,0-111.5s30.8-80.7,0-111.5c-30.8-30.8-80.7-30.8-111.5,0c-30.8,30.8-30.8,80.7,0,111.5s30.8,80.7,0,111.5
c-18.3,18.3-25.7,43.6-22.2,67.4c1.9,16.8,9.7,32.7,22.6,45.6c30.8,30.8,80.7,30.8,111.5,0c30.8-30.8,80.7-30.8,111.5,0
c30.8,30.8,80.7,30.8,111.5,0C446.3,410.9,446.3,361.1,415.5,330.3z"/>
<path class="st2" d="M519.9,468.2c0-62,0-124.7,0-188.2s0-126.3,0-188.2c16.4,0,32.7,0,49.1,0s32.7,0,48.3,0
c19.5,35.1,39.4,70.5,59.6,106.4s39.8,71.3,59.6,106.4c0-35.1,0-70.5,0-106.4s0-71.3,0-106.4c16,0,31.6,0,47.5,0s31.6,0,47.5,0
c0,62,0,124.7,0,188.2s0,126.3,0,188.2c-16,0-32,0-48.3,0c-16.4,0-32.7,0-49.1,0c-19.5-35.1-39.4-70.5-59.6-106.4
c-20.3-35.9-39.8-71.3-59.6-106.4c0,35.1,0,70.5,0,106.4s0,71.3,0,106.4c-16,0-31.6,0-47.5,0C551.9,468.2,535.9,468.2,519.9,468.2z
"/>
<path class="st2" d="M1053.4,477.2c-26.9,0-51.8-5.1-74.8-14.8c-23-9.7-42.5-23.4-59.2-41.3c-16.8-17.5-29.6-38.6-38.6-62.7
c-9.4-24.2-14-50.3-14-78.7s4.7-54.6,14-78.7c9.4-24.2,22.2-44.8,38.6-62.4c16.8-17.5,36.2-31.2,59.2-40.9
c23-9.7,47.9-14.8,74.8-14.8c26.9,0,51.8,5.1,74.4,14.8c22.6,9.7,42.5,23.4,59.2,40.9s29.6,38.2,39,62.4
c9.4,24.2,13.6,50.3,13.6,78.7s-4.7,54.6-13.6,78.7c-9.4,24.2-22.2,45.2-39,62.7s-36.6,31.6-59.2,41.3
C1105.3,472.1,1080.3,477.2,1053.4,477.2z M1053.4,387.6c17.9,0,33.5-4.7,46.4-13.6c12.9-9,23-21.8,30-37.8
c7-16.4,10.9-35.1,10.9-56.5c0-21.4-3.5-40.1-10.9-55.7c-7-16-17.1-28.4-30-37.4c-12.9-9-28.4-13.6-46.4-13.6
c-17.5,0-33.1,4.3-46.4,13.3c-13.3,9-23.4,21.4-30.4,37.4c-7,16-10.9,34.7-10.9,56.1c0,21.4,3.5,40.1,10.9,56.5
c7,16.4,17.1,28.8,30.4,37.8C1020.3,382.9,1035.9,387.6,1053.4,387.6z"/>
<path class="st2" d="M1275.2,468.2c0-62,0-124.7,0-188.2s0-126.3,0-188.2c23,0,46,0,69.4,0s46.4,0,69.4,0
c10.5,37.8,21.4,75.6,32,114.2s21,76.8,31.2,114.2c10.1-37.8,20.7-75.6,31.2-114.2c10.5-38.6,21-76.8,31.2-114.2
c23,0,45.6,0,68.6,0c23,0,45.6,0,68.2,0c0.4,62,0.8,124.7,1.2,188.2c0.4,63.5,0.8,126.3,1.2,188.2c-15.6,0-31.2,0-46.8,0
c-15.6,0-31.2,0-46.8,0c0-42.1,0-84.6,0-127.4s0-85.3,0-127.4c-10.9,42.1-22.2,84.6-33.9,127.4c-11.3,42.9-22.6,85.3-33.9,127.4
c-13.6,0-27.7,0-41.7,0c-14,0-28.4,0-42.5,0c-10.9-41.3-22.2-83-33.1-125.5c-10.9-42.1-22.2-84.2-33.1-125.5c0,41.3,0,83,0,125.5
c0,42.1,0,84.2,0,125.5c-14.8,0-30,0-45.2,0C1306,468.2,1290.4,468.2,1275.2,468.2z"/>
<path class="st2" d="M1714,468.2c19.1-62,38.6-124.7,57.7-188.2c19.5-63.5,38.6-126.3,57.7-188.2c21.8,0,43.6,0,66.3,0
c22.2,0,44.4,0,66.3,0c19.1,62,38.6,124.7,57.7,188.2c19.5,63.5,38.6,126.3,57.7,188.2c-16,0-32,0-48.3,0s-32.7,0-49.1,0
c-3.5-11.7-7-23.8-10.5-35.9c-3.5-12.1-7-23.8-10.5-35.9c-21,0-42.1,0-63.5,0c-21,0-42.5,0-63.5,0c-3.5,11.7-7,23.8-10.5,35.9
s-7,23.8-10.5,35.9c-16,0-32,0-48.3,0C1746.7,468.2,1730.4,468.2,1714,468.2z M1857,314.3c12.9,0,25.7,0,39,0c13.3,0,26.1,0,39,0
c-6.2-21.8-12.9-43.6-19.5-65.9s-13.3-44-19.5-65.9c-6.2,21.8-12.9,43.6-19.5,65.9C1869.9,270.6,1863.3,292.9,1857,314.3z"/>
<path class="st2" d="M2119.3,468.2c0-62,0-124.7,0-188.2s0-126.3,0-188.2c22.2,0,44.4,0,67,0c22.6,0,44.8,0,67,0
c27.3,0,52.2,4.7,75.2,14c23,9.4,42.9,22.6,59.6,39.8c17.1,17.1,30,36.6,39.8,59.6c9.4,22.6,14,47.5,14,74.4s-4.7,51.8-14,74.8
c-9.4,23-22.6,42.9-39.8,60s-37,30.4-59.6,39.8c-23,9.4-47.9,14-75.2,14c-22.2,0-44.4,0-67,0
C2163.7,468.2,2141.5,468.2,2119.3,468.2z M2253.4,179.5c-5.8,0-12.1,0-18.3,0c-6.2,0-12.5,0-18.7,0c0,33.1,0,66.6,0,100.5
s0,67.4,0,100.5c6.2,0,12.5,0,18.7,0c6.2,0,12.5,0,18.3,0c18.3,0,34.7-4.3,48.3-13.3c13.6-9,24.2-21,31.6-36.2
c7.4-15.2,10.9-32.7,10.9-51.8s-3.5-36.2-10.9-51.4c-7.4-15.2-17.9-26.9-31.6-35.9C2287.7,183.7,2271.7,179.5,2253.4,179.5z"/>
</g>
</svg>
This diff is collapsed.
This diff is collapsed.
{
"authors": [
"Sbailò, Luigi",
"Ghiringhelli, Luca M."
],
"email": "sbailo@fhi-berlin.mpg.de",
"title": "Introduction to clustering",
"description": "In this tutorial, we introduce to the most popular clustering algorithms. We focus on partitioning, hierarchical and density-based clustering algorithms. The methods are tested on synthetic datasets of increasing complexity",
"notebook_name": "clustering_tutorial.ipynb",
"url": "https://gitlab.mpcdf.mpg.de/nomad-lab/analytics-clustering-tutorial",
"link": "https://analytics-toolkit.nomad-coe.eu/hub/user-redirect/notebooks/tutorials/clustering_tutorial.ipynb",
"link_public": "https://analytics-toolkit.nomad-coe.eu/public/user-redirect/notebooks/tutorials/clustering_tutorial.ipynb",
"updated": "2021-01-21",
"flags":{
"featured": true,
"top_of_list": false
},
"labels": {
"application_section": [
"Tutorials for artificial-intelligence methods"
],
"application_system": [
"Synthetic data"
],
"category": [
"beginner_tutorial"
],
"ai_methods": [
"Unsupervised learning",
"Clustering",
"k-means",
"Hierarchical clustering",
"DBSCAN",
"HDBSCAN"
],
"platform": [
"jupyter"
]
}
}
numpy
matplotlib
scikit-learn
hdbscan
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment