ConfigSpace

1.2.2 · active · verified Thu Apr 16

ConfigSpace is a Python library designed to manage configuration spaces for automated algorithm configuration and hyperparameter optimization tasks. It provides a straightforward API for defining hyperparameters, their ranges, conditional dependencies, and forbidden clauses. ConfigSpace is frequently used in AutoML tools such as SMAC3, BOHB, and auto-sklearn. The current stable version is 1.2.2, released on December 19, 2025, and it maintains an active release cadence.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to create a `ConfigurationSpace` object and add `Float` and `Integer` hyperparameters with defined ranges and default values. It then shows how to sample a single configuration from the space and access its values.

from ConfigSpace import ConfigurationSpace, Float, Integer

# Create a simple ConfigurationSpace
cs = ConfigurationSpace(space={
    "alpha": (0.0, 1.0, 0.5), # UniformFloat with lower, upper, default
    "max_iter": (10, 100, 55), # UniformInteger with lower, upper, default
}, seed=1234)

print(cs)

# Sample a configuration
config = cs.sample_configuration()
print(config)

# Access values like a dictionary
print(f"Alpha: {config['alpha']}")

view raw JSON →