Welcome to ConfigSpace’s documentation!

ConfigSpace is a simple python package to manage configuration spaces for algorithm configuration and hyperparameter optimization tasks. It includes various modules to translate between different text formats for configuration space descriptions.

ConfigSpace is often used in AutoML tools such as SMAC3, BOHB or auto-sklearn. To read more about our group and projects, visit our homepage AutoML.org.

This documentation explains how to use ConfigSpace and demonstrates its features. In the Quickstart, you will see how to set up a ConfigurationSpace and add hyperparameters of different types to it. Besides containing hyperparameters, a ConfigurationSpace can contain constraints such as conditions and forbidden clauses. Those are introduced in the user guide.

Furthermore, in the serialization section, it will be explained how to serialize a ConfigurationSpace for later usage.

Basic usage

>>> import ConfigSpace as CS
>>> import ConfigSpace.hyperparameters as CSH
>>> cs = CS.ConfigurationSpace(seed=1234)
>>> a = CSH.UniformIntegerHyperparameter('a', lower=10, upper=100, log=False)
>>> b = CSH.CategoricalHyperparameter('b', choices=['red', 'green', 'blue'])
>>> cs.add_hyperparameters([a, b])
[a, Type: UniformInteger, Range: [10, 100], Default: 55,...]
>>> cs.sample_configuration()
  'a': 27,
  'b': 'green',


ConfigSpace requires Python 3.7 or higher.

ConfigSpace can be installed with pip:

pip install ConfigSpace

The ConfigSpace package requires numpy, cython and pyparsing. Additionally, a functioning C compiler is required.

On Ubuntu, the required compiler tools and Python headers can be installed with:

sudo apt-get install build-essential python3 python3-dev

When using Anaconda/Miniconda, the compiler has to be installed with:

conda install gxx_linux-64 gcc_linux-64

Citing the ConfigSpace

    title   = {BOAH: A Tool Suite for Multi-Fidelity Bayesian Optimization & Analysis of Hyperparameters},
    author  = {M. Lindauer and K. Eggensperger and M. Feurer and A. Biedenkapp and J. Marben and P. Müller and F. Hutter},
    journal = {arXiv:1908.06756 {[cs.LG]}},
    date    = {2019},