Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _get_skopt_backend(self):
"""Get a scikit-optimize backend regardless of whether currently using one."""
if isinstance(self.backend, SkoptBackend):
return self.backend
skopt_backend_args = (self._examples, self._old_params)
if self._skopt_backend_args == skopt_backend_args:
return self._skopt_backend
self._skopt_backend_args = skopt_backend_args
self._skopt_backend = SkoptBackend(*skopt_backend_args)
return self._skopt_backend
return self.optimizer.space
@property
def model(self):
"""Get the most recently fit model."""
return self.optimizer.models[-1]
# Registered names:
SkoptBackend.register()
SkoptBackend.register_alias("skopt")
SkoptBackend.register_alg("gaussian_process", base_estimator="GP")
SkoptBackend.register_alg("random_forest", base_estimator="RF")
SkoptBackend.register_alg("extra_trees", base_estimator="ET")
SkoptBackend.register_alg("gradient_boosted_regression_trees", base_estimator="GBRT")
def _get_skopt_backend(self):
"""Get a scikit-optimize backend regardless of whether currently using one."""
if isinstance(self.backend, SkoptBackend):
return self.backend
skopt_backend_args = (self._examples, self._old_params)
if self._skopt_backend_args == skopt_backend_args:
return self._skopt_backend
self._skopt_backend_args = skopt_backend_args
self._skopt_backend = SkoptBackend(*skopt_backend_args)
return self._skopt_backend
self.current_values = make_values(params, current_point)
@property
def space(self):
"""The space over which optimization was performed."""
return self.optimizer.space
@property
def model(self):
"""Get the most recently fit model."""
return self.optimizer.models[-1]
# Registered names:
SkoptBackend.register()
SkoptBackend.register_alias("skopt")
SkoptBackend.register_alg("gaussian_process", base_estimator="GP")
SkoptBackend.register_alg("random_forest", base_estimator="RF")
SkoptBackend.register_alg("extra_trees", base_estimator="ET")
SkoptBackend.register_alg("gradient_boosted_regression_trees", base_estimator="GBRT")
@property
def space(self):
"""The space over which optimization was performed."""
return self.optimizer.space
@property
def model(self):
"""Get the most recently fit model."""
return self.optimizer.models[-1]
# Registered names:
SkoptBackend.register()
SkoptBackend.register_alias("skopt")
SkoptBackend.register_alg("gaussian_process", base_estimator="GP")
SkoptBackend.register_alg("random_forest", base_estimator="RF")
SkoptBackend.register_alg("extra_trees", base_estimator="ET")
SkoptBackend.register_alg("gradient_boosted_regression_trees", base_estimator="GBRT")