IOHClustering
IOHClustering provides an interface for clustering problems, allowing users to map a dataset and a specified number of clusters to the IOHprofiler problem format. This enables seamless integration with the IOHprofiler framework for further analysis and performance evaluation.
As part of the IOHprofiler framework, IOHClustering is under active development. Some features may still be evolving, with potential updates to functionality and interfaces.
Features
- Transform datasets into clustering problems compatible with the IOHprofiler framework.
- Real-world datasets for clustering, such as:
- Iris dataset
- Wine dataset
- KC1 dataset
- Glass dataset
Installation
The minimum supported Python version is 3.10. Install IOHClustering via pip and git:
pip install iohclustering
Basic Usage
Examples and Tutorials
Below are several examples demonstrating how to use IOHClustering for various clustering tasks. These examples cover basic usage, working with benchmark problems, solving custom datasets, and defining custom evaluation functions.
Example: Clustering a Dataset
The following example shows how to get a benchmark clustering problem (by name or ID) the IOHClustering framework:
from iohclustering import get_problem, download_benchmark_datasets
# Get benchmark problem by name (e.g., "iris_pca") with k=2 clusters
clustering_problem, retransform = get_problem(fid="iris_pca", k=2)
# Alternatively, get benchmark problem by its ID (e.g., ID=5) with k=2 clusters
clustering_problem, retransform = get_problem(fid=5, k=2)
# Print metadata of the clustering problem
print(clustering_problem.meta_data)
# Set up a logger to store results in the specified directory
logger = ioh.logger.Analyzer(
root=os.getcwd(), # Current working directory
folder_name="AttachedLogger", # Folder to store logs
algorithm_name="None", # Name of the algorithm (can be customized)
)
# Attach the logger to the created clustering problem
clustering_problem.attach_logger(logger)
Example: Listing Available Benchmark Problems
You can retrieve a list of all benchmark problems available in IOHClustering:
from iohclustering import load_problems
problems = load_problems()
for problem in problems.keys():
print(problem)
Tutorials
Explore the following Jupyter notebooks for step-by-step tutorials on using IOHClustering:
- Custom Dataset and Random Search Tutorial: Learn how to define clustering problems with your own datasets and explore solutions using random search.
- Custom Metric and Random Search Tutorial: Understand how to define custom clustering metrics and solve clustering problems with random search.
License
This project is licensed under a standard BSD-3 clause License. See the LICENSE file for details.
Acknowledgments
This work has been estabilished as a collaboration between:
- Diederick Vermetten
- Catalin-Viorel Dinu
- Marcus Gallagher
Cite Us
Citation information coming soon!
Metadata
Release files for iohclustering 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| iohclustering-0.0.3.tar.gz | 72.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| iohclustering-0.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 144.7 kB
Release files / iohclustering-0.0.3.tar.gz
| Download URL | iohclustering-0.0.3.tar.gz |
|---|---|
| Size | 72.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b1e9a762a26df843f67a4de74f2fb30d86630020dba108e702759ea2dd9b0fac
|
|
BLAKE2b-256 checksum How to use checksums |
caeaf82a8bc144615d4622658e99026cedabdc99c2289e1398c672809cf90302
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 29, 2025.
Transparency logRelease files / iohclustering-0.0.3-py3-none-any.whl
| Download URL | iohclustering-0.0.3-py3-none-any.whl |
|---|---|
| Size | 72.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f91acabc40e319ea057110e1eacad7e775ec0e917f97d8635260ae8ddea7f247
|
|
BLAKE2b-256 checksum How to use checksums |
d904d0c27cc8775d62ae065d6ca06d09e7986c5e1909973aa96a415a91ff1628
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 29, 2025.
Transparency log