class_docstr: Binary Gaussian process classification based on Laplace approximation.
  
  The implementation is based on Algorithm 3.1, 3.2, and 5.1 from [RW2006]_.
  
  Internally, the Laplace approximation is used for approximating the
  non-Gaussian posterior by a Gaussian.
  
  Currently, the implementation is restricted to using the logistic link
  function.
  
  .. versionadded:: 0.18
  
  Parameters
  ----------
  kernel : kernel instance, default=None
      The kernel specifying the covariance function of the GP. If None is
      passed, the kernel "1.0 * RBF(1.0)" is used as default. Note that
      the kernel's hyperparameters are optimized during fitting.
  
  optimizer : 'fmin_l_bfgs_b' or callable, default='fmin_l_bfgs_b'
      Can either be one of the internally supported optimizers for optimizing
      the kernel's parameters, specified by a string, or an externally
      defined optimizer passed as a callable. If a callable is passed, it
      must have the  signature::
  
          def optimizer(obj_func, initial_theta, bounds):
              # * 'obj_func' is the objective function to be maximized, which
              #   takes the hyperparameters theta as parameter and an
              #   optional flag eval_gradient, which determines if the
              #   gradient is returned additionally to the function value
              # * 'initial_theta': the initial value for theta, which can be
              #   used by local optimizers
              # * 'bounds': the bounds on the values of theta
              ....
              # Returned are the best found hyperparameters theta and
              # the corresponding value of the target function.
              return theta_opt, func_min
  
      Per default, the 'L-BFGS-B' algorithm from scipy.optimize.minimize
      is used. If None is passed, the kernel's parameters are kept fixed.
      Available internal optimizers are::
  
          'fmin_l_bfgs_b'
  
  n_restarts_optimizer : int, default=0
      The number of restarts of the optimizer for finding the kernel's
      parameters which maximize the log-marginal likelihood. The first run
      of the optimizer is performed from the kernel's initial parameters,
      the remaining ones (if any) from thetas sampled log-uniform randomly
      from the space of allowed theta-values. If greater than 0, all bounds
      must be finite. Note that n_restarts_optimizer=0 implies that one
      run is performed.
  
  max_iter_predict : int, default=100
      The maximum number of iterations in Newton's method for approximating
      the posterior during predict. Smaller values will reduce computation
      time at the cost of worse results.
  
  warm_start : bool, default=False
      If warm-starts are enabled, the solution of the last Newton iteration
      on the Laplace approximation of the posterior mode is used as
      initialization for the next call of _posterior_mode(). This can speed
      up convergence when _posterior_mode is called several times on similar
      problems as in hyperparameter optimization. See :term:`the Glossary
      <warm_start>`.
  
  copy_X_train : bool, default=True
      If True, a persistent copy of the training data is stored in the
      object. Otherwise, just a reference to the training data is stored,
      which might cause predictions to change if the data is modified
      externally.
  
  random_state : int, RandomState instance or None, default=None
      Determines random number generation used to initialize the centers.
      Pass an int for reproducible results across multiple function calls.
      See :term:`Glossary <random_state>`.
  
  Attributes
  ----------
  X_train_ : array-like of shape (n_samples, n_features) or list of object
      Feature vectors or other representations of training data (also
      required for prediction).
  
  y_train_ : array-like of shape (n_samples,)
      Target values in training data (also required for prediction)
  
  classes_ : array-like of shape (n_classes,)
      Unique class labels.
  
  kernel_ : kernl instance
      The kernel used for prediction. The structure of the kernel is the
      same as the one passed as parameter but with optimized hyperparameters
  
  L_ : array-like of shape (n_samples, n_samples)
      Lower-triangular Cholesky decomposition of the kernel in X_train_
  
  pi_ : array-like of shape (n_samples,)
      The probabilities of the positive class for the training points
      X_train_
  
  W_sr_ : array-like of shape (n_samples,)
      Square root of W, the Hessian of log-likelihood of the latent function
      values for the observed labels. Since W is diagonal, only the diagonal
      of sqrt(W) is stored.
  
  log_marginal_likelihood_value_ : float
      The log-marginal-likelihood of ``self.kernel_.theta``
  
  References
  ----------
  .. [RW2006] `Carl E. Rasmussen and Christopher K.I. Williams,
     "Gaussian Processes for Machine Learning",
     MIT Press 2006 <https://www.gaussianprocess.org/gpml/chapters/RW.pdf>`_
class_docstr_tok: ["Binary","Gaussian","process","classification","based","on","Laplace","approximation",".","The","implementation","is","based","on","Algorithm","3.1",",","3.2",",","and","5.1","from","[","RW2006","]","_.","Internally",",","the","Laplace","approximation","is","used","for","approximating","the","non-Gaussian","posterior","by","a","Gaussian",".","Currently",",","the","implementation","is","restricted","to","using","the","logistic","link","function",".","..","versionadded",":",":","0.18","Parameters","--","--","--","--","--","kernel",":","kernel","instance",",","default=None","The","kernel","specifying","the","covariance","function","of","the","GP",".","If","None","is","passed",",","the","kernel","``","1.0","*","RBF","(","1.0",")","''","is","used","as","default",".","Note","that","the","kernel","'s","hyperparameters","are","optimized","during","fitting",".","optimizer",":","'fmin_l_bfgs_b","'","or","callable",",","default='fmin_l_bfgs_b'","Can","either","be","one","of","the","internally","supported","optimizers","for","optimizing","the","kernel","'s","parameters",",","specified","by","a","string",",","or","an","externally","defined","optimizer","passed","as","a","callable",".","If","a","callable","is","passed",",","it","must","have","the","signature",":",":","def","optimizer","(","obj_func",",","initial_theta",",","bounds",")",":","#","*","'obj_func","'","is","the","objective","function","to","be","maximized",",","which","#","takes","the","hyperparameters","theta","as","parameter","and","an","#","optional","flag","eval_gradient",",","which","determines","if","the","#","gradient","is","returned","additionally","to","the","function","value","#","*","'initial_theta","'",":","the","initial","value","for","theta",",","which","can","be","#","used","by","local","optimizers","#","*","'bounds","'",":","the","bounds","on","the","values","of","theta","....","#","Returned","are","the","best","found","hyperparameters","theta","and","#","the","corresponding","value","of","the","target","function",".","return","theta_opt",",","func_min","Per","default",",","the","'","L-BFGS-B","'","algorithm","from","scipy.optimize.minimize","is","used",".","If","None","is","passed",",","the","kernel","'s","parameters","are","kept","fixed",".","Available","internal","optimizers","are",":",":","'fmin_l_bfgs_b'","n_restarts_optimizer",":","int",",","default=0","The","number","of","restarts","of","the","optimizer","for","finding","the","kernel's","parameters","which","maximize","the","log-marginal","likelihood",".","The","first","run","of","the","optimizer","is","performed","from","the","kernel","'s","initial","parameters",",","the","remaining","ones","(","if","any",")","from","thetas","sampled","log-uniform","randomly","from","the","space","of","allowed","theta-values",".","If","greater","than","0",",","all","bounds","must","be","finite",".","Note","that","n_restarts_optimizer=0","implies","that","one","run","is","performed",".","max_iter_predict",":","int",",","default=100","The","maximum","number","of","iterations","in","Newton","'s","method","for","approximating","the","posterior","during","predict",".","Smaller","values","will","reduce","computation","time","at","the","cost","of","worse","results",".","warm_start",":","bool",",","default=False","If","warm-starts","are","enabled",",","the","solution","of","the","last","Newton","iteration","on","the","Laplace","approximation","of","the","posterior","mode","is","used","as","initialization","for","the","next","call","of","_posterior_mode","(",")",".","This","can","speed","up","convergence","when","_posterior_mode","is","called","several","times","on","similar","problems","as","in","hyperparameter","optimization",".","See",":","term",":","`","the","Glossary","<","warm_start",">","`",".","copy_X_train",":","bool",",","default=True","If","True",",","a","persistent","copy","of","the","training","data","is","stored","in","the","object",".","Otherwise",",","just","a","reference","to","the","training","data","is","stored",",","which","might","cause","predictions","to","change","if","the","data","is","modified","externally",".","random_state",":","int",",","RandomState","instance","or","None",",","default=None","Determines","random","number","generation","used","to","initialize","the","centers",".","Pass","an","int","for","reproducible","results","across","multiple","function","calls",".","See",":","term",":","`","Glossary","<","random_state",">","`",".","Attributes","--","--","--","--","--","X_train_",":","array-like","of","shape","(","n_samples",",","n_features",")","or","list","of","object","Feature","vectors","or","other","representations","of","training","data","(","also","required","for","prediction",")",".","y_train_",":","array-like","of","shape","(","n_samples",",",")","Target","values","in","training","data","(","also","required","for","prediction",")","classes_",":","array-like","of","shape","(","n_classes",",",")","Unique","class","labels",".","kernel_",":","kernl","instance","The","kernel","used","for","prediction",".","The","structure","of","the","kernel","is","the","same","as","the","one","passed","as","parameter","but","with","optimized","hyperparameters","L_",":","array-like","of","shape","(","n_samples",",","n_samples",")","Lower-triangular","Cholesky","decomposition","of","the","kernel","in","X_train_","pi_",":","array-like","of","shape","(","n_samples",",",")","The","probabilities","of","the","positive","class","for","the","training","points","X_train_","W_sr_",":","array-like","of","shape","(","n_samples",",",")","Square","root","of","W",",","the","Hessian","of","log-likelihood","of","the","latent","function","values","for","the","observed","labels",".","Since","W","is","diagonal",",","only","the","diagonal","of","sqrt","(","W",")","is","stored",".","log_marginal_likelihood_value_",":","float","The","log-marginal-likelihood","of","``","self.kernel_.theta","``","References","--","--","--","--","--","..","[","RW2006","]","`","Carl","E.","Rasmussen","and","Christopher","K.I",".","Williams",",","``","Gaussian","Processes","for","Machine","Learning","''",",","MIT","Press","2006","<","https",":","\/\/www.gaussianprocess.org\/gpml\/chapters\/RW.pdf",">","`","_"]
docstr: Perform classification on an array of test vectors X.
  
  Parameters
  ----------
  X : array-like of shape (n_samples, n_features) or list of object
      Query points where the GP is evaluated for classification.
  
  Returns
  -------
  C : ndarray of shape (n_samples,)
      Predicted target values for X, values are from ``classes_``
docstr_tok: ["Perform","classification","on","an","array","of","test","vectors","X.","Parameters","--","--","--","--","--","X",":","array-like","of","shape","(","n_samples",",","n_features",")","or","list","of","object","Query","points","where","the","GP","is","evaluated","for","classification",".","Returns","--","--","--","-","C",":","ndarray","of","shape","(","n_samples",",",")","Predicted","target","values","for","X",",","values","are","from","``","classes_","``"]
code: def predict(self, X):
      """Perform classification on an array of test vectors X.
  
      Parameters
      ----------
      X : array-like of shape (n_samples, n_features) or list of object
          Query points where the GP is evaluated for classification.
  
      Returns
      -------
      C : ndarray of shape (n_samples,)
          Predicted target values for X, values are from ``classes_``
      """
      check_is_fitted(self)
  
      # As discussed on Section 3.4.2 of GPML, for making hard binary
      # decisions, it is enough to compute the MAP of the posterior and
      # pass it through the link function
      K_star = self.kernel_(self.X_train_, X)  # K_star =k(x_star)
      f_star = K_star.T.dot(
          self.y_train_ - self.pi_
      )  # Algorithm 3.2,Line 4
  
      return np.where(f_star > 0, self.classes_[1], self.classes_[0])
  
imports: from numbers import Integral
  from operator import itemgetter
  import numpy
  import scipy.optimize
  from scipy.linalg import cho_solve, cholesky, solve
  from scipy.special import erf, expit
  from ..base import BaseEstimator, ClassifierMixin, _fit_context, clone
  from ..multiclass import OneVsOneClassifier, OneVsRestClassifier
  from ..preprocessing import LabelEncoder
  from ..utils import check_random_state
  from ..utils._param_validation import Interval, StrOptions
  from ..utils.optimize import _check_optimize_result
  from ..utils.validation import check_is_fitted
  from .kernels import RBF, CompoundKernel, Kernel
  from .kernels import ConstantKernel
label_desc: Use image node_id 3 for calling the _BinaryGaussianProcessClassifierLaplace obj's underlying member method code with example usage: obj.predict(X) and returns: np