Getting started

Install AMBER

Requirements: Python 3.9 or later.

pip install amber-som

This installs AMBER together with its required dependencies: NumPy, pandas, matplotlib, Plotly, tqdm, and scikit-learn.

Optional dependencies

Package

Install

Required for

scipy

pip install scipy

Welch PSD for spectral features; improved skewness/kurtosis

librosa

pip install librosa

MFCC feature extraction

Install with extras in one command:

pip install "amber-som[spectral]"      # adds scipy
pip install "amber-som[mfcc]"          # adds librosa
pip install "amber-som[spectral,mfcc]" # both

Install from source

git clone https://github.com/albertonogales/AMBER.git
cd AMBER
pip install -e ".[dev]"   # editable install with test dependencies

Verify the installation

import AMBER
print(AMBER.__version__)   # e.g. 2.0.0
print(AMBER.__all__)

Five-line quick start

import numpy as np
import AMBER

data = np.random.rand(200, 8)
som  = AMBER.Map(data=data, period=100)          # map size chosen automatically
cls  = AMBER.Classification(som, data)
print(f"Quantisation error : {cls.quantization_error:.4f}")
print(f"Topological error  : {cls.topological_error:.4f}")
AMBER.Visualization.heat_map(cls)

Running the tests

pip install -r requirements-dev.txt
pytest        # 372 tests, ~99 % coverage

A coverage HTML report is written to coverage_html/.