MCPcopy Create free account
hub / github.com/modAL-python/modAL / max_UCB

Function max_UCB

modAL/acquisition.py:145–162  ·  view source on GitHub ↗

Maximum UCB query strategy. Selects the instance with highest upper confidence bound. Args: optimizer: The :class:`~modAL.models.BayesianOptimizer` object for which the utility is to be calculated. X: The samples for which the maximum upper confidence bound is to be calcula

(optimizer: BaseLearner, X: modALinput, beta: float = 1,
            n_instances: int = 1)

Source from the content-addressed store, hash-verified

143
144
145def max_UCB(optimizer: BaseLearner, X: modALinput, beta: float = 1,
146 n_instances: int = 1) -> np.ndarray:
147 """
148 Maximum UCB query strategy. Selects the instance with highest upper confidence bound.
149
150 Args:
151 optimizer: The :class:`~modAL.models.BayesianOptimizer` object for which the utility is to be calculated.
152 X: The samples for which the maximum upper confidence bound is to be calculated.
153 beta: Value controlling the beta parameter.
154 n_instances: Number of samples to be queried.
155
156 Returns:
157 The indices of the instances from X chosen to be labelled.
158 The ucb metric of the chosen instances.
159
160 """
161 ucb = optimizer_UCB(optimizer, X, beta=beta)
162 return multi_argmax(ucb, n_instances=n_instances)

Callers

nothing calls this directly

Calls 2

multi_argmaxFunction · 0.90
optimizer_UCBFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…