class_docstr: Train a Multinomial Naive Bayes model.
  
  .. versionadded:: 0.9.0
class_docstr_tok: ["Train","a","Multinomial","Naive","Bayes","model",".","..","versionadded",":",":","0.9.0"]
docstr: Train a Naive Bayes model given an RDD of (label, features)
  vectors.
  
  This is the `Multinomial NB <http://tinyurl.com/lsdw6p>`_ which
  can handle all kinds of discrete data.  For example, by
  converting documents into TF-IDF vectors, it can be used for
  document classification. By making every vector a 0-1 vector,
  it can also be used as `Bernoulli NB <http://tinyurl.com/p7c96j6>`_.
  The input feature values must be nonnegative.
  
  .. versionadded:: 0.9.0
  
  Parameters
  ----------
  data : :py:class:`pyspark.RDD`
      The training data, an RDD of :py:class:`pyspark.mllib.regression.LabeledPoint`.
  lambda\_ : float, optional
      The smoothing parameter.
      (default: 1.0)
docstr_tok: ["Train","a","Naive","Bayes","model","given","an","RDD","of","(","label",",","features",")","vectors",".","This","is","the","`","Multinomial","NB","<","http",":","\/\/tinyurl.com\/lsdw6p",">","`","_","which","can","handle","all","kinds","of","discrete","data",".","For","example",",","by","converting","documents","into","TF-IDF","vectors",",","it","can","be","used","for","document","classification",".","By","making","every","vector","a","0-1","vector",",","it","can","also","be","used","as","`","Bernoulli","NB","<","http",":","\/\/tinyurl.com\/p7c96j6",">","`","_",".","The","input","feature","values","must","be","nonnegative",".","..","versionadded",":",":","0.9.0","Parameters","--","--","--","--","--","data",":",":","py",":","class",":","`","pyspark.RDD","`","The","training","data",",","an","RDD","of",":","py",":","class",":","`","pyspark.mllib.regression.LabeledPoint","`",".","lambda\\_",":","float",",","optional","The","smoothing","parameter",".","(","default",":","1.0",")"]
code: def train(
      cls, data: RDD[LabeledPoint], lambda_: float = 1.0
  ) -> NaiveBayesModel:
      """
      Train a Naive Bayes model given an RDD of (label, features)
      vectors.
  
      This is the `Multinomial NB <http://tinyurl.com/lsdw6p>`_ which
      can handle all kinds of discrete data.  For example, by
      converting documents into TF-IDF vectors, it can be used for
      document classification. By making every vector a 0-1 vector,
      it can also be used as `Bernoulli NB <http://tinyurl.com/p7c96j6>`_.
      The input feature values must be nonnegative.
  
      .. versionadded:: 0.9.0
  
      Parameters
      ----------
      data : :py:class:`pyspark.RDD`
          The training data, an RDD of :py:class:`pyspark.mllib.regression.LabeledPoint`.
      lambda\\_ : float, optional
          The smoothing parameter.
          (default: 1.0)
      """
      first = data.first()
      if not isinstance(first, LabeledPoint):
          raise ValueError("`data` should be an RDD of LabeledPoint")
      labels, pi, theta = callMLlibFunc(
          "trainNaiveBayesModel", data, lambda_
      )
      return NaiveBayesModel(
          labels.toArray(), pi.toArray(), numpy.array(theta)
      )
  
imports: from math import exp
  import sys
  import warnings
  from typing import Any, Iterable, Optional, Union, overload, TYPE_CHECKING
  import numpy
  from pyspark import RDD, SparkContext, since
  from pyspark.streaming.dstream import DStream
  from pyspark.mllib.common import callMLlibFunc, _py2java, _java2py
  from pyspark.mllib.linalg import _convert_to_vector
  from pyspark.mllib.regression import LabeledPoint, LinearModel, _regression_train_wrapper, StreamingLinearAlgorithm
  from pyspark.mllib.util import Saveable, Loader, inherit_doc
  from pyspark.mllib.linalg import Vector
  from pyspark.mllib.regression import LabeledPoint
label_desc: Use image node_id 1 for calling the NaiveBayes obj's underlying member method code with example usage: obj.train(cls, data, lambda_) and returns: NaiveBayesModel