lenskit.tuning.spec#
Attributes#
Classes#
Configuration options for the hyperparameter search. |
|
Data model for hyperparameter tuning specifications. |
|
Load a pipeline from a file. |
|
Module Contents#
- lenskit.tuning.spec.SearchSpace#
- class lenskit.tuning.spec.SearchConfig#
Bases:
pydantic.BaseModelConfiguration options for the hyperparameter search.
- default_points: int = 60#
The default number of search points, if not limited by a maximum configuration.
- num_cpus: int | Literal['threads', 'all-threads'] = 'threads'#
The number of CPUs to request from Ray Tune.
- class lenskit.tuning.spec.TuningSpec#
Bases:
pydantic.BaseModelData model for hyperparameter tuning specifications.
- classmethod load(path)#
- Parameters:
path (pathlib.Path)
- Return type:
- 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:
- class lenskit.tuning.spec.PipelineFile#
Bases:
pydantic.BaseModelLoad a pipeline from a file.
- file: pathlib.Path#
The file from whic to load the pipeline.
- class lenskit.tuning.spec.SearchParam#
Bases:
pydantic.BaseModel- type: Literal['int', 'float']#
The type of this parameter.
- scale: Literal['uniform', 'log'] = 'uniform'#
Search scale for parameter values.
Exported Aliases#
- lenskit.tuning.spec.lenskit_config()#
Re-exported alias for
lenskit.config.lenskit_config().
- lenskit.tuning.spec.load_config_data()#
Re-exported alias for
lenskit.config.load_config_data().
- class lenskit.tuning.spec.PipelineConfig#
Re-exported alias for
lenskit.pipeline.config.PipelineConfig.