Skip to main content

Package for IOH Clustering problems

Project description

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

# Download benchmark datasets
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:

  1. Custom Dataset and Random Search Tutorial: Learn how to define clustering problems with your own datasets and explore solutions using random search.
  2. 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

Cite Us

Citation information coming soon!

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

iohclustering-0.0.1b0.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

iohclustering-0.0.1b0-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file iohclustering-0.0.1b0.tar.gz.

File metadata

  • Download URL: iohclustering-0.0.1b0.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for iohclustering-0.0.1b0.tar.gz
Algorithm Hash digest
SHA256 26c52ad82b4161f4739f70ef9554474ee4efac086ea24c6c91491d09a67b9bf1
MD5 92ff3f79f15ba78d35b59811d0794d47
BLAKE2b-256 361cb9944e9b4ec86aae3d46d7e064f7acfc6e33ba3f05b4810b0ff8453eb14e

See more details on using hashes here.

Provenance

The following attestation bundles were made for iohclustering-0.0.1b0.tar.gz:

Publisher: python-publish.yml on IOHprofiler/IOHClustering

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file iohclustering-0.0.1b0-py3-none-any.whl.

File metadata

File hashes

Hashes for iohclustering-0.0.1b0-py3-none-any.whl
Algorithm Hash digest
SHA256 fef6d7b7e15086762c5692a8b9e1282e13355c0b75ffa2fafc8af0b5ce6b0e33
MD5 43468b8d01e99d31666f5070d72bf4c1
BLAKE2b-256 282d1fb57692b2dc63b4e01768c49c7a983472795dc65ceba1a0a348b0ff0963

See more details on using hashes here.

Provenance

The following attestation bundles were made for iohclustering-0.0.1b0-py3-none-any.whl:

Publisher: python-publish.yml on IOHprofiler/IOHClustering

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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