lenskit.schemas.tuning.TuningSpec#

class lenskit.schemas.tuning.TuningSpec#

Bases: pydantic.BaseModel

Data model for hyperparameter tuning specifications.

classmethod load(path)#

Load the tuning specification from the file.

Note

This load does not merge the global defaults.

Parameters:

path (pathlib.Path)

Return type:

TuningSpec

file_path: Annotated[pathlib.Path | None, Field(exclude=True)] = None#

The path to the spec file.

search: SearchConfig#

Options for the hyperparameter search.

space: dict[str, SearchSpace]#

The search space for tuning.

pipeline: PipelineFile | lenskit.schemas.pipeline.PipelineConfig#

The pipeline to tune.

property component_name: str | None#

Get the name of the tuned component, if the search specifies parameters for a single component.

Return type:

str | None

resolve_path(path)#

Resolve a path relative to this specification’s file.

Parameters:

path (pathlib.Path | str)

Return type:

pathlib.Path