Skip to main content

GSCpy

This is a package for performing Spectral Clustering.

It works a near-fully unsupervised way : the only required information is the number of clusters .

The clustering is done using the Generalized Spectral Clustering (GSC) framework developped by Jonckheere et al. in arXiv:2203.03221. It has been shown experimentally that this framework regularly outperforms classical spectral clustering for synthetic and real datasets.

Classical spectral clustering can also be performed by tweaking the parameters, as the clustering algorithm used is fully customizable.

Usage

Interacting with the package is done trough the GSC class, representing a GSC model. To use :

  • Create a GSC object with the parameters of your choice
  • Cluster your data using the fit method of the class
  • Retrieve the clustering using the labels attribute
  • Get more information on the clustering by using the available instance attributes (cluster centers, eigenvalues of the graph laplacian, adjacency matrix, Calinski-Harabasz index)
  • Evaluate the performance of the clustering using the nmi method.

To help you manage your datasets, GSCpy includes a file manager allowing to easily load and save datasets with their labels.The package also includes an interactive 2D dataset builder, powered by matplotlib.

Installation

GSCpy is entirely written in Python and requires the following libraries to run correctly :

  • NumPy
  • Matplotlib
  • SciPy
  • Scikit-learn

You can install GSCpy and every required library using pip :

pip install GSCpy

Pypi repository of the project : GSCpy · PyPI

Test

You can test your GSCpy installation using this simple script :

import gscpy

data,labels_true=gscpy.build_dataset(save=True,name='test')
k=2 #The number of clusters you built
model=gscpy.GSC(k)
model.fit(data)
print('Clustering  NMI score' ,model.nmi(labels_true))

This project was carried out as part of an internship at LAAS-CNRS, Toulouse.

Metadata

Release files for GSCpy 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for GSCpy 1.0.2
File Size Uploaded
gscpy-1.0.2.tar.gz 11.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for GSCpy 1.0.2
File Interpreter ABI Platform
GSCpy-1.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 25.8 kB

Release files / gscpy-1.0.2.tar.gz

Download URL gscpy-1.0.2.tar.gz
Size 11.8 kB
Tags Source
SHA-256 checksum
How to use checksums
b7bd067761c13cdb7e63d8db1db08b473a6b65ab9ce07449d16cac69f0ac07a9
BLAKE2b-256 checksum
How to use checksums
218d63b66bea335198746ac7012a6e29deec9d30e8aa60d364642b4d06bb763d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.12.2

Release files / GSCpy-1.0.2-py3-none-any.whl

Download URL GSCpy-1.0.2-py3-none-any.whl
Size 14.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5716e84aab898987f132b2ee91c0cc9888dbf47c386ca3e5cd45bf6a28248991
BLAKE2b-256 checksum
How to use checksums
4b11bfc1a72dbcf34a36a4af96db248c82f8d697f46ca1d1220b078b0f714c0f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.12.2

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files

1.0.1

2 release files

1.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page