Quantum Fog  0.9.3
Public Member Functions | Public Attributes | List of all members
learning.NaiveBayesLner.NaiveBayesLner Class Reference
Inheritance diagram for learning.NaiveBayesLner.NaiveBayesLner:
Inheritance graph
[legend]
Collaboration diagram for learning.NaiveBayesLner.NaiveBayesLner:
Collaboration graph
[legend]

Public Member Functions

def __init__ (self, states_df, tar_vtx, vtx_to_states=None)
 
def learn_net_struc (self)
 
- Public Member Functions inherited from learning.NetStrucLner.NetStrucLner
def __init__ (self, is_quantum, states_df, vtx_to_states=None)
 
def fill_bnet_with_parents (self, vtx_to_parents)
 

Public Attributes

 tar_vtx
 
- Public Attributes inherited from learning.NetStrucLner.NetStrucLner
 is_quantum
 
 bnet
 
 states_df
 
 ord_nodes
 

Additional Inherited Members

- Static Public Member Functions inherited from learning.NetStrucLner.NetStrucLner
def learn_nd_state_names (bnet, states_df)
 
def import_nd_state_names (bnet, vtx_to_states)
 
def int_sts_detector (sub_states_df)
 

Detailed Description

NaiveBayesLner (Naive Bayes Learner). This class assumes a Naive Bayes
structure without any regard for the data in states_df. This means it
assumes a tree structure with arrows radiating from the specified target
vertex to all other vertices mentioned in the list of column labels of
states_df.

Although ``naive", this model is often sufficiently good for
classification purposes. In such problems, the non-target node names (
column labels of dataframe) are called ``features" and the states of the
target node are called ``classes" of the ``classifier"

Attributes
----------
is_quantum : bool
    True for quantum bnets amd False for classical bnets
bnet : BayesNet
    a BayesNet in which we store what is learned
states_df : pandas.DataFrame
    a Pandas DataFrame with training data. column = node and row =
    sample. Each row/sample gives the state of the col/node.
ord_nodes : list[DirectedNode]
    a list of DirectedNode's named and in the same order as the column
    labels of self.states_df.
tar_vtx : str
    The name of the node that will assume the role of ``target" or
    center of the graph.

Constructor & Destructor Documentation

def learning.NaiveBayesLner.NaiveBayesLner.__init__ (   self,
  states_df,
  tar_vtx,
  vtx_to_states = None 
)
Constructor

Parameters
----------
states_df : pandas.DataFrame
tar_vtx : str
vtx_to_states : dict[str, list[str]]
    A dictionary mapping each node name to a list of its state names.
    This information will be stored in self.bnet. If
    vtx_to_states=None, constructor will learn vtx_to_states
    from states_df

Returns
-------

Member Function Documentation

def learning.NaiveBayesLner.NaiveBayesLner.learn_net_struc (   self)
Stores in self.bnet the info that tar_vtx is parent of all other
nodes.

Returns
-------
None

The documentation for this class was generated from the following file: