Skip to content

Getting ConfigurationSpace should be a class method #1283

Open
@eddiebergman

Description

@eddiebergman

Currently the test code has a lot of creating objects just to get the configuration space and then setting hyperparameters.

pipeline = SimpleRegressionPipeline(dataset_properties=dataset_properties)
cs = pipeline.get_hyperparameter_search_space()

# ...later
config = cs.sample_configuration()
config._populate_values()

cls = SimpleRegressionPipeline(
    random_state=1,
    dataset_properties=dataset_properties
)
cls.set_hyperparameters(config)

Seeing as the configuration space doesn't rely on anything except the dataset_properties set through the constructor and whatever the constructor can deduce from this, it would be more syntactically clear to move get_hyperparameters_search_space() to be a @classmethod

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions