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

Function max_PI

modAL/acquisition.py:105–122  ·  view source on GitHub ↗

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

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

Source from the content-addressed store, hash-verified

103
104
105def max_PI(optimizer: BaseLearner, X: modALinput, tradeoff: float = 0,
106 n_instances: int = 1) -> np.ndarray:
107 """
108 Maximum PI query strategy. Selects the instance with highest probability of improvement.
109
110 Args:
111 optimizer: The :class:`~modAL.models.BayesianOptimizer` object for which the utility is to be calculated.
112 X: The samples for which the probability of improvement is to be calculated.
113 tradeoff: Value controlling the tradeoff parameter.
114 n_instances: Number of samples to be queried.
115
116 Returns:
117 The indices of the instances from X chosen to be labelled.
118 The pi metric of the chosen instances.
119
120 """
121 pi = optimizer_PI(optimizer, X, tradeoff=tradeoff)
122 return multi_argmax(pi, n_instances=n_instances)
123
124
125def max_EI(optimizer: BaseLearner, X: modALinput, tradeoff: float = 0,

Callers

nothing calls this directly

Calls 2

multi_argmaxFunction · 0.90
optimizer_PIFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…