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

Function max_EI

modAL/acquisition.py:125–142  ·  view source on GitHub ↗

Maximum EI query strategy. Selects the instance with highest expected improvement. Args: optimizer: The :class:`~modAL.models.BayesianOptimizer` object for which the utility is to be calculated. X: The samples for which the expected improvement is to be calculated.

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

Source from the content-addressed store, hash-verified

123
124
125def max_EI(optimizer: BaseLearner, X: modALinput, tradeoff: float = 0,
126 n_instances: int = 1) -> np.ndarray:
127 """
128 Maximum EI query strategy. Selects the instance with highest expected improvement.
129
130 Args:
131 optimizer: The :class:`~modAL.models.BayesianOptimizer` object for which the utility is to be calculated.
132 X: The samples for which the expected improvement is to be calculated.
133 tradeoff: Value controlling the tradeoff parameter.
134 n_instances: Number of samples to be queried.
135
136 Returns:
137 The indices of the instances from X chosen to be labelled.
138 The ei metric of the chosen instances.
139
140 """
141 ei = optimizer_EI(optimizer, X, tradeoff=tradeoff)
142 return multi_argmax(ei, n_instances=n_instances)
143
144
145def max_UCB(optimizer: BaseLearner, X: modALinput, beta: float = 1,

Callers

nothing calls this directly

Calls 2

multi_argmaxFunction · 0.90
optimizer_EIFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…