Skip to main content

Spectral Clustering

Project description

Spectral Clustering

Overview

This is a Python re-implementation of the spectral clustering algorithm in the paper Speaker Diarization with LSTM.

refinement

Disclaimer

This is not the original implementation used by the paper.

Specifically, in this implementation, we use the K-Means from scikit-learn, which does NOT support customized distance measure like cosine distance.

Tutorial

Simply use the cluster() method of class SpectralClusterer to perform spectral clustering.

from spectralcluster import SpectralClusterer

clusterer = SpectralClusterer(
    min_clusters=2,
    max_clusters=100,
    p_percentile=0.95,
    gaussian_blur_sigma=1)

labels = clusterer.cluster(X)

The input X is a numpy array of shape (n_samples, n_features), and the returned 1abels is a numpy array of shape (n_samples,).

For the complete list of parameters of the clusterer, see spectralcluster/spectral_clusterer.py.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spectralcluster-0.0.1.tar.gz (4.0 kB view hashes)

Uploaded Source

Built Distribution

spectralcluster-0.0.1-py3-none-any.whl (9.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page