lenskit.tuning#
Tune parameters using Ray Tune.
Submodules#
Classes#
Set up and run a hyperparameter tuning job for a pipeline. |
Package Contents#
- class lenskit.tuning.PipelineTuner(spec, out_dir=None, rng=None)#
Set up and run a hyperparameter tuning job for a pipeline.
- Stability:
Experimental
- Parameters:
out_dir (pathlib.Path | None)
rng (lenskit.random.RNGInput)
- settings: lenskit.config.TuneSettings#
- out_dir: pathlib.Path#
- random_seed: numpy.random.SeedSequence#
- harness: Any#
- tuner: ray.tune.Tuner#
The Ray tuner that is used for tuning. Not available until
setup()has been called.
- results: ray.tune.ResultGrid#
Ray tuning results. Only available after
run()has been called.
- log#
- property mode#
- set_data(train, test, *, name=None)#
Set the data to be used for tuning.
- Parameters:
train (lenskit.data.Dataset | pathlib.Path)
name (str | None)
- best_result(*, scope='all')#
Get the best configuration and its validation metrics.
- Parameters:
scope (str) – The metric search scope for iterative training. Set to
"last"to use the last iteration instead of the best iteration. Seeray.tune.ResultGrid.get_best_result()for details.- Return type:
- best_pipeline()#
Get the (full) configuration for the best pipeline.
- Return type:
- search_space()#
Get the Ray search space.
- setup_harness()#
- property metric#
- create_tuner()#
Create a Ray tuner for the search.
- Return type:
Exported Aliases#
- class lenskit.tuning.TuningSpec#
Re-exported alias for
lenskit.tuning.spec.TuningSpec.