Skip to content

Ucb

ucb

Upper confidence bound (UCB).

Classes

UCB

UCB(
    regressor_distribution: BaseRegressorDistribution,
    kappa: float = 2.0,
    batch_size: int = 1,
    mc_size: int = 10000,
)

Bases: ConfidenceBound, BaseMaximum

The upper confidence bound (UCB).

This acquisition criterion is expressed as

M[x;κ]=E[Y(x)]+κ×S[Y(x)]

where Y is the random process modelling the uncertainty of the surrogate model f^ and κ>0.

Parameters:

  • regressor_distribution (BaseRegressorDistribution) –

    The distribution of the regressor.

  • kappa (float, default: 2.0 ) –

    A factor associated with the standard deviation to increase the mean value.

  • batch_size (int, default: 1 ) –

    The number of points to be acquired in parallel; if 1, acquire points sequentially.

  • mc_size (int, default: 10000 ) –

    The sample size to estimate the acquisition criterion in parallel.

Source code in src/gemseo_mlearning/active_learning/acquisition_criteria/maximum/_confidence_bound.py
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
def __init__(
    self,
    regressor_distribution: BaseRegressorDistribution,
    kappa: float = 2.0,
    batch_size: int = 1,
    mc_size: int = 10_000,
) -> None:
    """
    Args:
        regressor_distribution: The distribution of the regressor.
        kappa: A factor associated with the standard deviation
            to increase the mean value.
        batch_size: The number of points to be acquired in parallel;
            if `1`, acquire points sequentially.
        mc_size: The sample size to estimate the acquisition criterion in parallel.
    """  # noqa: D205 D212 D415
    self.__kappa = kappa
    super().__init__(regressor_distribution, batch_size=batch_size, mc_size=mc_size)
Attributes
MAXIMIZE class-attribute
MAXIMIZE: bool = True

Whether this acquisition criterion must be maximized.

output_range instance-attribute
output_range: float = max() - min()

The output range.

qoi property
qoi: Any

The quantity of interest.

Functions
update
update() -> None

Update the acquisition criterion.

Source code in src/gemseo_mlearning/active_learning/acquisition_criteria/maximum/base_maximum.py
31
32
33
34
35
def update(self) -> None:  # noqa: D102
    super().update()
    self._qoi = max(
        self._regressor_distribution.learning_set.output_dataset.to_numpy()
    )