Skip to content

Orders of Conjunctions result in unequal ConfigSpace #334

@dengdifan

Description

@dengdifan

Similar to #73 . However, if the order of two conjunctions (maybe also forbiddenclauses) is different, then the two configurations will be considered different ones:

from ConfigSpace import ConfigurationSpace, CategoricalHyperparameter
from ConfigSpace.conditions import EqualsCondition, OrConjunction

x = CategoricalHyperparameter('x', [1,2,3])
y = CategoricalHyperparameter('y', [0,1])
z = CategoricalHyperparameter('z', [0,1])

cs1 = ConfigurationSpace()
cs1.add_hyperparameters([x,y,z])
cs1.add_condition(
    OrConjunction(
        EqualsCondition(x, y, 0), EqualsCondition(x,z,0)
    )
)

cs2 = ConfigurationSpace()
cs2.add_hyperparameters([x,y,z])
cs2.add_condition(
    OrConjunction(
        EqualsCondition(x,z,0), EqualsCondition(x, y, 0)
    )
)
assert cs1 == cs2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions