lenskit.tuning.spec.TuningSpec#

class lenskit.tuning.spec.TuningSpec#

Bases: pydantic.BaseModel

Data model for hyperparameter tuning specifications.

classmethod load(path)#
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.pipeline.config.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