class_docstr: The `BayesianKernelDensityClassifier` estimator trains using Kernel Density estimations to generate the joint
  distribution.
  
  You can pass any keyword parameter that scikit-learn's
  [KernelDensity](https://scikit-learn.org/stable/modules/generated/sklearn.neighbors.KernelDensity.html)
  model uses and it will be passed along.
  
  Attributes
  ----------
  classes_ : np.ndarray of shape (n_classes,)
      The classes seen during `fit`.
  models_ : dict[int, KernelDensity]
      The models for each class seen during `fit`.
  priors_logp_ : dict
      The log priors for each class seen during `fit` (estimated as `np.log(len(x_subset) / len(X))`)
class_docstr_tok: ["The","`","BayesianKernelDensityClassifier","`","estimator","trains","using","Kernel","Density","estimations","to","generate","the","joint","distribution",".","You","can","pass","any","keyword","parameter","that","scikit-learn's","[","KernelDensity","]","(","https",":","\/\/scikit-learn.org\/stable\/modules\/generated\/sklearn.neighbors.KernelDensity.html",")","model","uses","and","it","will","be","passed","along",".","Attributes","--","--","--","--","--","classes_",":","np.ndarray","of","shape","(","n_classes",",",")","The","classes","seen","during","`","fit","`",".","models_",":","dict","[","int",",","KernelDensity","]","The","models","for","each","class","seen","during","`","fit","`",".","priors_logp_",":","dict","The","log","priors","for","each","class","seen","during","`","fit","`","(","estimated","as","`","np.log","(","len","(","x_subset",")","\/","len","(","X",")",")","`",")"]
docstr: Predict probabilities for `X` using fitted estimator and the joint distribution.
  
  The returned estimates for all classes are in the same order found in the `.classes_` attribute.
  
  Parameters
  ----------
  X : array-like of shape (n_samples, n_features)
      The data to predict.
  
  Returns
  -------
  array-like of shape (n_samples, n_classes)
      The predicted probabilities for each class, ordered as in `self.classes_`.
docstr_tok: ["Predict","probabilities","for","`","X","`","using","fitted","estimator","and","the","joint","distribution",".","The","returned","estimates","for","all","classes","are","in","the","same","order","found","in","the","`",".classes_","`","attribute",".","Parameters","--","--","--","--","--","X",":","array-like","of","shape","(","n_samples",",","n_features",")","The","data","to","predict",".","Returns","--","--","--","-","array-like","of","shape","(","n_samples",",","n_classes",")","The","predicted","probabilities","for","each","class",",","ordered","as","in","`","self.classes_","`","."]
code: def predict_proba(self, X):
      """Predict probabilities for `X` using fitted estimator and the joint distribution.
  
      The returned estimates for all classes are in the same order found in the `.classes_` attribute.
  
      Parameters
      ----------
      X : array-like of shape (n_samples, n_features)
          The data to predict.
  
      Returns
      -------
      array-like of shape (n_samples, n_classes)
          The predicted probabilities for each class, ordered as in `self.classes_`.
      """
      check_is_fitted(self)
      X = check_array(X, estimator=self, dtype=FLOAT_DTYPES)
  
      log_prior = np.array(
          [
              self.priors_logp_[target_label]
              for target_label in self.classes_
          ]
      )
  
      log_likelihood = np.array(
          [
              self.models_[target_label].score_samples(X)
              for target_label in self.classes_
          ]
      ).T
  
      log_likelihood_and_prior = np.exp(log_likelihood + log_prior)
      evidence = log_likelihood_and_prior.sum(axis=1, keepdims=True)
      posterior = log_likelihood_and_prior / evidence
      return posterior
  
file_path: scikit-lego/sklego/neighbors.py
imports: import numpy
  from sklearn.base import BaseEstimator, ClassifierMixin
  from sklearn.neighbors import KernelDensity
  from sklearn.utils import check_X_y
  from sklearn.utils.multiclass import unique_labels
  from sklearn.utils.validation import FLOAT_DTYPES, check_array, check_is_fitted
label_desc: Use image node_id 3 for calling the BayesianKernelDensityClassifier obj's underlying member method code with example usage: obj.predict_proba(X) and returns: posterior