class_docstr: This class is an abstract model of a Bayesian optimizer algorithm.
  
  Args:
      estimator: The estimator to be used in the Bayesian optimization. (For instance, a
          GaussianProcessRegressor.)
      query_strategy: Function providing the query strategy for Bayesian optimization,
          for instance, modAL.acquisitions.max_EI.
      X_training: Initial training samples, if available.
      y_training: Initial training labels corresponding to initial training samples.
      bootstrap_init: If initial training data is available, bootstrapping can be done during the first training.
          Useful when building Committee models with bagging.
      **fit_kwargs: keyword arguments.
  
  Attributes:
      estimator: The estimator to be used in the Bayesian optimization.
      query_strategy: Function providing the query strategy for Bayesian optimization.
      X_training: If the model hasn't been fitted yet it is None, otherwise it contains the samples
          which the model has been trained on.
      y_training: The labels corresponding to X_training.
      X_max: argmax of the function so far.
      y_max: Max of the function so far.
  
  Examples:
  
      >>> import numpy as np
      >>> from functools import partial
      >>> from sklearn.gaussian_process import GaussianProcessRegressor
      >>> from sklearn.gaussian_process.kernels import Matern
      >>> from modAL.models import BayesianOptimizer
      >>> from modAL.acquisition import optimizer_PI, optimizer_EI, optimizer_UCB, max_PI, max_EI, max_UCB
      >>>
      >>> # generating the data
      >>> X = np.linspace(0, 20, 1000).reshape(-1, 1)
      >>> y = np.sin(X)/2 - ((10 - X)**2)/50 + 2
      >>>
      >>> # assembling initial training set
      >>> X_initial, y_initial = X[150].reshape(1, -1), y[150].reshape(1, -1)
      >>>
      >>> # defining the kernel for the Gaussian process
      >>> kernel = Matern(length_scale=1.0)
      >>>
      >>> tr = 0.1
      >>> PI_tr = partial(optimizer_PI, tradeoff=tr)
      >>> PI_tr.__name__ = 'PI, tradeoff = %1.1f' % tr
      >>> max_PI_tr = partial(max_PI, tradeoff=tr)
      >>>
      >>> acquisitions = zip(
      ...     [PI_tr, optimizer_EI, optimizer_UCB],
      ...     [max_PI_tr, max_EI, max_UCB],
      ... )
      >>>
      >>> for acquisition, query_strategy in acquisitions:
      ...     # initializing the optimizer
      ...     optimizer = BayesianOptimizer(
      ...         estimator=GaussianProcessRegressor(kernel=kernel),
      ...         X_training=X_initial, y_training=y_initial,
      ...         query_strategy=query_strategy
      ...     )
      ...
      ...     for n_query in range(5):
      ...         # query
      ...         query_idx, query_inst = optimizer.query(X)
      ...         optimizer.teach(X[query_idx].reshape(1, -1), y[query_idx].reshape(1, -1))
class_docstr_tok: ["This","class","is","an","abstract","model","of","a","Bayesian","optimizer","algorithm",".","Args",":","estimator",":","The","estimator","to","be","used","in","the","Bayesian","optimization",".","(","For","instance",",","a","GaussianProcessRegressor",".",")","query_strategy",":","Function","providing","the","query","strategy","for","Bayesian","optimization",",","for","instance",",","modAL.acquisitions.max_EI",".","X_training",":","Initial","training","samples",",","if","available",".","y_training",":","Initial","training","labels","corresponding","to","initial","training","samples",".","bootstrap_init",":","If","initial","training","data","is","available",",","bootstrapping","can","be","done","during","the","first","training",".","Useful","when","building","Committee","models","with","bagging",".","*","*","fit_kwargs",":","keyword","arguments",".","Attributes",":","estimator",":","The","estimator","to","be","used","in","the","Bayesian","optimization",".","query_strategy",":","Function","providing","the","query","strategy","for","Bayesian","optimization",".","X_training",":","If","the","model","has","n't","been","fitted","yet","it","is","None",",","otherwise","it","contains","the","samples","which","the","model","has","been","trained","on",".","y_training",":","The","labels","corresponding","to","X_training",".","X_max",":","argmax","of","the","function","so","far",".","y_max",":","Max","of","the","function","so","far",".","Examples",":",">",">",">","import","numpy","as","np",">",">",">","from","functools","import","partial",">",">",">","from","sklearn.gaussian_process","import","GaussianProcessRegressor",">",">",">","from","sklearn.gaussian_process.kernels","import","Matern",">",">",">","from","modAL.models","import","BayesianOptimizer",">",">",">","from","modAL.acquisition","import","optimizer_PI",",","optimizer_EI",",","optimizer_UCB",",","max_PI",",","max_EI",",","max_UCB",">",">",">",">",">",">","#","generating","the","data",">",">",">","X","=","np.linspace","(","0",",","20",",","1000",")",".reshape","(","-1",",","1",")",">",">",">","y","=","np.sin","(","X",")","\/2","-","(","(","10","-","X",")","*","*","2",")","\/50","+","2",">",">",">",">",">",">","#","assembling","initial","training","set",">",">",">","X_initial",",","y_initial","=","X","[","150","]",".reshape","(","1",",","-1",")",",","y","[","150","]",".reshape","(","1",",","-1",")",">",">",">",">",">",">","#","defining","the","kernel","for","the","Gaussian","process",">",">",">","kernel","=","Matern","(","length_scale=1.0",")",">",">",">",">",">",">","tr","=","0.1",">",">",">","PI_tr","=","partial","(","optimizer_PI",",","tradeoff=tr",")",">",">",">","PI_tr.__name__","=","'PI",",","tradeoff","=","%","1.1f","'","%","tr",">",">",">","max_PI_tr","=","partial","(","max_PI",",","tradeoff=tr",")",">",">",">",">",">",">","acquisitions","=","zip","(","...","[","PI_tr",",","optimizer_EI",",","optimizer_UCB","]",",","...","[","max_PI_tr",",","max_EI",",","max_UCB","]",",","...",")",">",">",">",">",">",">","for","acquisition",",","query_strategy","in","acquisitions",":","...","#","initializing","the","optimizer","...","optimizer","=","BayesianOptimizer","(","...","estimator=GaussianProcessRegressor","(","kernel=kernel",")",",","...","X_training=X_initial",",","y_training=y_initial",",","...","query_strategy=query_strategy","...",")","...","...","for","n_query","in","range","(","5",")",":","...","#","query","...","query_idx",",","query_inst","=","optimizer.query","(","X",")","...","optimizer.teach","(","X","[","query_idx","]",".reshape","(","1",",","-1",")",",","y","[","query_idx","]",".reshape","(","1",",","-1",")",")"]
docstr: Gives the highest value so far.
  
  Returns:
      The location of the currently best value and the value itself.
docstr_tok: ["Gives","the","highest","value","so","far",".","Returns",":","The","location","of","the","currently","best","value","and","the","value","itself","."]
code: def get_max(self) -> Tuple:
      """
      Gives the highest value so far.
  
      Returns:
          The location of the currently best value and the value itself.
      """
      return self.X_max, self.y_max
  
imports: from typing import Any, Callable, List, Optional, Tuple
  import numpy
  from modAL.acquisition import max_EI
  from modAL.disagreement import max_std_sampling, vote_entropy_sampling
  from modAL.models.base import BaseCommittee, BaseLearner
  from modAL.uncertainty import uncertainty_sampling
  from modAL.utils.data import data_vstack, modALinput, retrieve_rows
  from modAL.utils.validation import check_class_labels, check_class_proba
  from sklearn.base import BaseEstimator
  from sklearn.metrics import accuracy_score
  from sklearn.utils import check_X_y
label_desc: Use image node_id 3 for calling the BayesianOptimizer obj's underlying member method code with example usage: obj.get_max() and returns: self,  self