Skip to content

np.array on Configuration returns names of HPs instead of values #363

Open
@benjamc

Description

@benjamc

When calling np.array on Configuration it returns names of HPs instead of values. Is that intended?
ConfigSpace 0.7.1

MWE:

import numpy as np
from ConfigSpace import ConfigurationSpace, Float

cs = ConfigurationSpace()
for i in range(3):
    cs.add_hyperparameter(Float(f"x_{i}", (0, 1)))

config = cs.sample_configuration()
print("output:", np.array(config))
print("expected:", config.get_array())

Output:

output: ['x_0' 'x_1' 'x_2']
expected: [0.09972031 0.91072326 0.16544557]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions