modAL.acquisition¶
Acquisition functions for Bayesian optimization.
-
modAL.acquisition.
max_EI
(optimizer: modAL.models.base.BaseLearner, X: Union[list, numpy.ndarray, scipy.sparse.csr.csr_matrix], tradeoff: float = 0, n_instances: int = 1) → Tuple[numpy.ndarray, Union[list, numpy.ndarray, scipy.sparse.csr.csr_matrix]][source]¶ Maximum EI query strategy. Selects the instance with highest expected improvement.
Parameters: - optimizer – The
BayesianOptimizer
object for which the utility is to be calculated. - X – The samples for which the expected improvement is to be calculated.
- tradeoff – Value controlling the tradeoff parameter.
- n_instances – Number of samples to be queried.
Returns: The indices of the instances from X chosen to be labelled; the instances from X chosen to be labelled.
- optimizer – The
-
modAL.acquisition.
max_PI
(optimizer: modAL.models.base.BaseLearner, X: Union[list, numpy.ndarray, scipy.sparse.csr.csr_matrix], tradeoff: float = 0, n_instances: int = 1) → Tuple[numpy.ndarray, Union[list, numpy.ndarray, scipy.sparse.csr.csr_matrix]][source]¶ Maximum PI query strategy. Selects the instance with highest probability of improvement.
Parameters: - optimizer – The
BayesianOptimizer
object for which the utility is to be calculated. - X – The samples for which the probability of improvement is to be calculated.
- tradeoff – Value controlling the tradeoff parameter.
- n_instances – Number of samples to be queried.
Returns: The indices of the instances from X chosen to be labelled; the instances from X chosen to be labelled.
- optimizer – The
-
modAL.acquisition.
max_UCB
(optimizer: modAL.models.base.BaseLearner, X: Union[list, numpy.ndarray, scipy.sparse.csr.csr_matrix], beta: float = 1, n_instances: int = 1) → Tuple[numpy.ndarray, Union[list, numpy.ndarray, scipy.sparse.csr.csr_matrix]][source]¶ Maximum UCB query strategy. Selects the instance with highest upper confidence bound.
Parameters: - optimizer – The
BayesianOptimizer
object for which the utility is to be calculated. - X – The samples for which the maximum upper confidence bound is to be calculated.
- beta – Value controlling the beta parameter.
- n_instances – Number of samples to be queried.
Returns: The indices of the instances from X chosen to be labelled; the instances from X chosen to be labelled.
- optimizer – The
-
modAL.acquisition.
optimizer_EI
(optimizer: modAL.models.base.BaseLearner, X: Union[list, numpy.ndarray, scipy.sparse.csr.csr_matrix], tradeoff: float = 0) → numpy.ndarray[source]¶ Expected improvement acquisition function for Bayesian optimization.
Parameters: - optimizer – The
BayesianOptimizer
object for which the utility is to be calculated. - X – The samples for which the expected improvement is to be calculated.
- tradeoff – Value controlling the tradeoff parameter.
Returns: Expected improvement utility score.
- optimizer – The
-
modAL.acquisition.
optimizer_PI
(optimizer: modAL.models.base.BaseLearner, X: Union[list, numpy.ndarray, scipy.sparse.csr.csr_matrix], tradeoff: float = 0) → numpy.ndarray[source]¶ Probability of improvement acquisition function for Bayesian optimization.
Parameters: - optimizer – The
BayesianOptimizer
object for which the utility is to be calculated. - X – The samples for which the probability of improvement is to be calculated.
- tradeoff – Value controlling the tradeoff parameter.
Returns: Probability of improvement utility score.
- optimizer – The
-
modAL.acquisition.
optimizer_UCB
(optimizer: modAL.models.base.BaseLearner, X: Union[list, numpy.ndarray, scipy.sparse.csr.csr_matrix], beta: float = 1) → numpy.ndarray[source]¶ Upper confidence bound acquisition function for Bayesian optimization.
Parameters: - optimizer – The
BayesianOptimizer
object for which the utility is to be calculated. - X – The samples for which the upper confidence bound is to be calculated.
- beta – Value controlling the beta parameter.
Returns: Upper confidence bound utility score.
- optimizer – The