Skip to content

Commit

Permalink
Improved optimize docstring to link to other relvant pieces of docume…
Browse files Browse the repository at this point in the history
…ntation
  • Loading branch information
AKuederle committed Mar 15, 2022
1 parent 358d2a9 commit ab6e550
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions tpcp/_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,17 @@ class OptimizablePipeline(Pipeline, _skip_validation=True):
This should not be a reimplementation of GridSearch or similar methods.
For this :class:`tpcp.pipelines.GridSearch` should be used directly.
It is important that `self_optimize` only modifies input parameters of the pipeline.
This means, if a parameter is optimized, by `self_optimize` it should be named in the `__init__` and should be
exportable when calling `pipeline.get_params`.
It is important that `self_optimize` only modifies input parameters of the pipeline that are marked as
`OptimizableParameter`.
This means, if a parameter is optimized, by `self_optimize` it should be named in the `__init__`, should be
exportable when calling `pipeline.get_params` and should be annotated using the `OptimizableParameter` type hint on
class level.
For the sake of documentation (and potential automatic checks) in the future, it also makes sense to add the
`HyperParameter` type annotation to all parameters that act as hyper parameters for the optimization performed in
`self_optimize`.
To learn more about parameter annotations check this `example <optimize_pipelines>`_ and this `
guide <optimization>`_ in the docs.
It is also possible to optimize nested parameters.
For example, if the input of the pipeline is an algorithm or another pipeline on its own, all parameters of these
objects can be modified as well.
Expand Down

0 comments on commit ab6e550

Please sign in to comment.