MCPcopy Index your code
hub / github.com/bayesian-optimization/BayesianOptimization / res

Method res

bayes_opt/target_space.py:654–685  ·  view source on GitHub ↗

Get all target values and constraint fulfillment for all parameters. Returns ------- res: list A list of dictionaries with the keys 'target', 'params', and 'constraint'. The value of 'target' is the target value, the value of 'params' is a

(self)

Source from the content-addressed store, hash-verified

652 return res
653
654 def res(self) -> list[dict[str, Any]]:
655 """Get all target values and constraint fulfillment for all parameters.
656
657 Returns
658 -------
659 res: list
660 A list of dictionaries with the keys 'target', 'params', and
661 'constraint'. The value of 'target' is the target value, the value
662 of 'params' is a dictionary with the parameter names as keys and the
663 parameter values as values, and the value of 'constraint' is the
664 constraint fulfillment.
665
666 Notes
667 -----
668 Does not report if points are within the bounds of the parameter space.
669 """
670 if self._constraint is None:
671 params = [self.array_to_params(p) for p in self.params]
672
673 return [{"target": target, "params": param} for target, param in zip(self.target, params)]
674
675 params = [self.array_to_params(p) for p in self.params]
676
677 return [
678 {"target": target, "constraint": constraint_value, "params": param, "allowed": allowed}
679 for target, constraint_value, param, allowed in zip(
680 self.target,
681 self._constraint_values,
682 params,
683 self._constraint.allowed(self._constraint_values),
684 )
685 ]
686
687 def set_bounds(self, new_bounds: BoundsMapping) -> None:
688 """Change the lower and upper search bounds.

Callers 5

test_resFunction · 0.95
test_res_categoricalFunction · 0.95
test_stepFunction · 0.45

Calls 2

array_to_paramsMethod · 0.95
allowedMethod · 0.80

Tested by 5

test_resFunction · 0.76
test_res_categoricalFunction · 0.76
test_stepFunction · 0.36