Objective

class blop.objectives.Objective(name, description='', type='continuous', target=None, constraint=None, transform=None, weight=1.0, active=True, trust_domain=None, min_noise=1e-06, max_noise=1.0, units=None, latent_groups=None, min_points_to_train=4)[source]

Bases: object

An objective to be used by an agent.

Parameters:
name: str

The name of the objective to optimize. This is used as a key to index observed data.

description: str

A longer description for the objective.

Deprecated since version v0.8.0: This argument is deprecated and will be removed in Blop v1.0.0.

type: Literal[“continuous”, “binary”, “ordinal”, “categorical”]

Describes the type of the outcome to be optimized. An outcome can be:

  • Continuous, meaning any real number.

  • Binary, meaning that it can take one of two values (e.g. [on, off])

  • Ordinal, meaning ordered categories (e.g. [low, medium, high])

  • Categorical, meaning non-ordered categories (e.g. [mango, banana, papaya])

Deprecated since version v0.8.0: This argument is deprecated and will be removed in Blop v1.0.0. Only DOFs will have types.

Default: “continuous”

target: str

One of “min” or “max”. The agent will respectively minimize or maximize the outcome. Each Objective must have either a target or a constraint. Default: “max”

constraint: Optional[Union[tuple[float, float], set[int], set[str]]]

A tuple of floats for continuous outcomes, or a set of outcomes for discrete outcomes. An Objective will only be ‘satisfied’ if it lies within the constraint. Each Objective must have either a target or a constraint. Default: None

transform: Optional[Literal[“log”, “logit”, “arctanh”]]

One of “log”, “logit”, or “arctanh”, to transform the outcomes and make them more Gaussian. Default: None

Deprecated since version v0.8.0: This argument is deprecated and will be removed in Blop v1.0.0. Only DOFs will have transforms. Use digestion functions to transform your objectives.

weight: float

The relative importance of this Objective, to be used when scalarizing in multi-objective optimization. Default: 1.

Deprecated since version v0.8.0: This argument is deprecated and will be removed in Blop v1.0.0. Use a digestion function to weight your objectives.

active: bool

If True, optimize this objective. Otherwise, monitor the objective, only. Default: True

trust_domain: Union[tuple[float, float], set[int], set[str]]

A tuple of floats for continuous outcomes, or a set of outcomes for discrete outcomes. An outcome outside the trust_domain will not be trusted and will be ignored as ‘invalid’. By default, all values are trusted. Default: None

Deprecated since version v0.8.0: This argument is deprecated and will be removed in Blop v1.0.0. Use constraints instead.

min_noise: float

The minimum relative noise level of the fitted model. Default: 1e-6

Deprecated since version v0.8.0: This argument is deprecated and will be removed in Blop v1.0.0.

max_noise: float

The maximum relative noise level of the fitted model. Default: 1e0

Deprecated since version v0.8.0: This argument is deprecated and will be removed in Blop v1.0.0.

units: str

A label representing the units of the outcome (e.g., millimeters or counts) Default: None

Deprecated since version v0.8.0: This argument is deprecated and will be removed in Blop v1.0.0.

latent_groups: list of tuples of strs, optional

An agent will fit latent dimensions to all DOFs with the same latent_group. All other DOFs will be modeled independently. Only used for LatentGPs. Default: None

min_points_to_train: int

How many new points to wait for before retraining model hyperparameters. Default: 4

Deprecated since version v0.8.0: This argument is deprecated and will be removed in Blop v1.0.0.

property search_domain: tuple[float, float] | set[int] | set[str] | set[bool]
property trust_domain: tuple[float, float] | set[int] | set[str] | set[bool]

If _trust_domain is None, then we trust the entire domain (so we return the domain).

property domain: tuple[float, float] | set[int] | set[str] | set[bool]

The total domain of the objective.

evaluate_constraint(y)[source]

Evaluate whether each value in y satisfies the constraint of the Objective.

property all_valid: bool
log_total_constraint(x)[source]

What is the log probability that a sample at x will be valid and satisfy the constraint of the Objective?

property label_with_units: str
property noise_bounds: tuple[float, float]
property summary: Series

Return a Series summarizing the state of the Objectives.

Deprecated since version v0.8.0: This method is deprecated and will be removed in Blop v1.0.0. Objectives will not have a summary.

property noise: float
property snr: int | None
property n_valid: int
constraint_probability(x)[source]

How much of the posterior on the outcome at x satisfies the constraint?

validity_probability(x)[source]
property model: Model | None

Deprecated since version v0.8.0: This method is deprecated and will be removed in Blop v1.0.0. Models will not be stored in individaul Objectives.

property sign: int