class_docstr: Class to represent Naive Bayes. Naive Bayes is a special case of Bayesian Model
  where the only edges in the model are from the feature variables to the dependent variable.
class_docstr_tok: ["Class","to","represent","Naive","Bayes",".","Naive","Bayes","is","a","special","case","of","Bayesian","Model","where","the","only","edges","in","the","model","are","from","the","feature","variables","to","the","dependent","variable","."]
docstr: Add an edge between `u` and `v`.
  
  The nodes `u` and `v` will be automatically added if they are
  not already in the graph. `u` will be the dependent variable (i.e. variable to be predicted)
  and `v` will be one of the features (i.e. predictors) in the model.
  
  Parameters
  ----------
  u, v : nodes
         Nodes can be any hashable python object.
  
  Returns
  -------
  None
  
  Examples
  --------
  >>> from pgmpy.models import NaiveBayes
  >>> G = NaiveBayes()
  >>> G.add_nodes_from(['a', 'b', 'c'])
  >>> G.add_edge('a', 'b')
  >>> G.add_edge('a', 'c')
  >>> G.edges()
  OutEdgeView([('a', 'b'), ('a', 'c')])
docstr_tok: ["Add","an","edge","between","`","u","`","and","`","v","`",".","The","nodes","`","u","`","and","`","v","`","will","be","automatically","added","if","they","are","not","already","in","the","graph",".","`","u","`","will","be","the","dependent","variable","(","i.e",".","variable","to","be","predicted",")","and","`","v","`","will","be","one","of","the","features","(","i.e",".","predictors",")","in","the","model",".","Parameters","--","--","--","--","--","u",",","v",":","nodes","Nodes","can","be","any","hashable","python","object",".","Returns","--","--","--","-","None","Examples","--","--","--","--",">",">",">","from","pgmpy.models","import","NaiveBayes",">",">",">","G","=","NaiveBayes","(",")",">",">",">","G.add_nodes_from","(","[","'","a","'",",","'","b","'",",","'","c","'","]",")",">",">",">","G.add_edge","(","'","a","'",",","'","b","'",")",">",">",">","G.add_edge","(","'","a","'",",","'","c","'",")",">",">",">","G.edges","(",")","OutEdgeView","(","[","(","'","a","'",",","'","b","'",")",",","(","'","a","'",",","'","c","'",")","]",")"]
code: def add_edge(self, u, v, *kwargs):
      """
      Add an edge between `u` and `v`.
  
      The nodes `u` and `v` will be automatically added if they are
      not already in the graph. `u` will be the dependent variable (i.e. variable to be predicted)
      and `v` will be one of the features (i.e. predictors) in the model.
  
      Parameters
      ----------
      u, v : nodes
             Nodes can be any hashable python object.
  
      Returns
      -------
      None
  
      Examples
      --------
      >>> from pgmpy.models import NaiveBayes
      >>> G = NaiveBayes()
      >>> G.add_nodes_from(['a', 'b', 'c'])
      >>> G.add_edge('a', 'b')
      >>> G.add_edge('a', 'c')
      >>> G.edges()
      OutEdgeView([('a', 'b'), ('a', 'c')])
      """
      if self.dependent and u != self.dependent:
          raise ValueError(
              f"Model can only have edges outgoing from: {self.dependent}"
          )
      self.dependent = u
      self.features.add(v)
      super(NaiveBayes, self).add_edge(u, v, *kwargs)
  
file_path: pgmpy/pgmpy/models/NaiveBayes.py
imports: from pgmpy.independencies import Independencies
  from pgmpy.models import BayesianNetwork
label_desc: Use image node_id 2 for calling the NaiveBayes obj's underlying member method code with example usage: obj.add_edge(u, v) without return types