baybe.surrogates.gaussian_process.components.generic.to_component_factory¶
- baybe.surrogates.gaussian_process.components.generic.to_component_factory(obj: Kernel | FitCriterion | Kernel | Mean | Likelihood | GPComponentFactoryProtocol, /, *, component_type: GPComponentType | None = None)[source]¶
Wrap a component into a plain component factory (with factory passthrough).
- Parameters:
obj (
Kernel|FitCriterion|Kernel|Mean|Likelihood|GPComponentFactoryProtocol) – The component or factory to convert.component_type (
Optional[GPComponentType]) – An optional restriction on the allowed component type.
- Return type:
- Returns:
A component factory.
- Raises:
TypeError – If the given component does not match the allowed types.