lenskit.tuning.PipelineTuner ============================ .. py:class:: lenskit.tuning.PipelineTuner(spec, out_dir = None, rng = None) :canonical: lenskit.tuning._search.PipelineTuner Set up and run a hyperparameter tuning job for a pipeline. :Stability: Experimental .. py:attribute:: settings :type: lenskit.config.TuneSettings .. py:attribute:: spec :type: lenskit.tuning.spec.TuningSpec .. py:attribute:: out_dir :type: pathlib.Path .. py:attribute:: pipe_name :type: str | None .. py:attribute:: random_seed :type: numpy.random.SeedSequence .. py:attribute:: iterative :type: bool .. py:attribute:: data :type: lenskit.splitting.TTSplit .. py:attribute:: harness :type: Any .. py:attribute:: tuner :type: ray.tune.Tuner The Ray tuner that is used for tuning. Not available until :meth:`setup` has been called. .. py:attribute:: results :type: ray.tune.ResultGrid Ray tuning results. Only available after :meth:`run` has been called. .. py:attribute:: log .. py:property:: mode .. py:method:: set_data(train, test, *, name = None) Set the data to be used for tuning. .. py:method:: setup() Set up to run the trainer. After this method completes, the :attr:`tuner` is ready. .. py:method:: run() Run the tuning job. Saves the results in :attr:`results`, and also returns them. .. py:method:: best_result(*, scope = 'all') Get the best configuration and its validation metrics. :param scope: The metric search scope for iterative training. Set to ``"last"`` to use the last iteration instead of the best iteration. See :meth:`ray.tune.ResultGrid.get_best_result` for details. .. py:method:: best_pipeline() Get the (full) configuration for the best pipeline. .. py:method:: search_space() Get the Ray search space. .. py:method:: setup_harness() .. py:property:: metric .. py:method:: create_tuner() Create a Ray tuner for the search.