class_docstr: Naive Bayes classifier for multinomial models.
  
  Multinomial Naive Bayes model learns from occurrences between features such as word counts
  and discrete classes. The input vector must contain positive values, such as
  counts or TF-IDF values.
  
  
  Parameters
  ----------
  alpha
      Additive (Laplace/Lidstone) smoothing parameter (use 0 for no smoothing).
  
  Attributes
  ----------
  class_dist : proba.Multinomial
      Class prior probability distribution.
  feature_counts : collections.defaultdict
      Total frequencies per feature and class.
  class_totals : collections.Counter
      Total frequencies per class.
  
  Examples
  --------
  
  >>> import pandas as pd
  >>> from river import compose
  >>> from river import feature_extraction
  >>> from river import naive_bayes
  
  >>> docs = [
  ...     ("Chinese Beijing Chinese", "yes"),
  ...     ("Chinese Chinese Shanghai", "yes"),
  ...     ("Chinese Macao", "maybe"),
  ...     ("Tokyo Japan Chinese", "no")
  ... ]
  
  >>> model = compose.Pipeline(
  ...     ("tokenize", feature_extraction.BagOfWords(lowercase=False)),
  ...     ("nb", naive_bayes.MultinomialNB(alpha=1))
  ... )
  
  >>> for sentence, label in docs:
  ...     model.learn_one(sentence, label)
  
  >>> model["nb"].p_class("yes")
  0.5
  
  >>> model["nb"].p_class("no")
  0.25
  
  >>> model["nb"].p_class("maybe")
  0.25
  
  >>> model.predict_proba_one("test")
  {'yes': 0.413, 'maybe': 0.310, 'no': 0.275}
  
  >>> model.predict_one("test")
  'yes'
  
  You can train the model and make predictions in mini-batch mode using the class methods
  `learn_many` and `predict_many`.
  
  >>> df_docs = pd.DataFrame(docs, columns = ["docs", "y"])
  
  >>> X = pd.Series([
  ...    "Chinese Beijing Chinese",
  ...    "Chinese Chinese Shanghai",
  ...    "Chinese Macao",
  ...    "Tokyo Japan Chinese"
  ... ])
  
  >>> y = pd.Series(["yes", "yes", "maybe", "no"])
  
  >>> model = compose.Pipeline(
  ...     ("tokenize", feature_extraction.BagOfWords(lowercase=False)),
  ...     ("nb", naive_bayes.MultinomialNB(alpha=1))
  ... )
  
  >>> model.learn_many(X, y)
  
  >>> unseen = pd.Series(["Taiwanese Taipei", "Chinese Shanghai"])
  
  >>> model.predict_proba_many(unseen)
        maybe        no       yes
  0  0.373272  0.294931  0.331797
  1  0.160396  0.126733  0.712871
  
  >>> model.predict_many(unseen)
  0    maybe
  1      yes
  dtype: object
  
  References
  ----------
  [^1]: [Naive Bayes text classification](https://nlp.stanford.edu/IR-book/html/htmledition/naive-bayes-text-classification-1.html)
docstr: Computes the joint log likelihood of input features.
  
  Parameters
  ----------
  x
      Dictionary of term frequencies.
  
  Returns
  -------
  Mapping between classes and joint log likelihood.
docstr_tok: ["Computes","the","joint","log","likelihood","of","input","features",".","Parameters","--","--","--","--","--","x","Dictionary","of","term","frequencies",".","Returns","--","--","--","-","Mapping","between","classes","and","joint","log","likelihood","."]
code: def joint_log_likelihood(self, x):
      """Computes the joint log likelihood of input features.
  
      Parameters
      ----------
      x
          Dictionary of term frequencies.
  
      Returns
      -------
      Mapping between classes and joint log likelihood.
  
      """
      return {
          c: math.log(self.p_class(c))
          + sum(
              frequency * math.log(self.p_feature_given_class(f, c))
              for f, frequency in x.items()
          )
          for c in self.classes_
      }
  
imports: from __future__ import annotations
  import collections
  import math
  import numpy
  import pandas
  from scipy import sparse
  from river.base import tags
  from .None import base
label_desc: Use image node_id 9 for calling the MultinomialNB obj's underlying member method code with example usage: obj.joint_log_likelihood(x) and returns: unknown