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

Public Member Functions

def __init__ (self, states_df, alpha, min_sam_per_cell=5, verbose=False, vtx_to_states=None, learn_later=False)
 
def find_MB (self, vtx=None)
 
- Public Member Functions inherited from learning.MB_BasedLner.MB_BasedLner
def __init__ (self, states_df, alpha, verbose=False, vtx_to_states=None, learn_later=False)
 
def learn_struc (self)
 
def find_MB (self, vtx=None)
 
def find_nbors (self)
 
def orient_edges (self)
 
def new_filled_nx_graph (self)
 
def undo_cycles (self)
 
def orient_undecided_edges (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

 min_sam_per_cell
 
 vtx_to_MB
 
- Public Attributes inherited from learning.MB_BasedLner.MB_BasedLner
 alpha
 
 verbose
 
 vtx_to_MB
 
 vtx_to_parents
 
 vtx_to_nbors
 
- Public Attributes inherited from learning.NetStrucLner.NetStrucLner
 is_quantum
 
 bnet
 
 states_df
 
 ord_nodes
 

Additional Inherited Members

- Static Public Member Functions inherited from learning.MB_BasedLner.MB_BasedLner
def MB_lner_test (LnerClass, verbose=False)
 
- 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

The MB_fast_IAMB_Lner (fast Incremental Association Markov Blanket
Learner) is a subclass of MB_BasedLner. See docstring for MB_BasedLner
for more info about this type of algo.

See Shunkai Fu Thesis for pseudo code on which this class is based.

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.

alpha : float
    threshold used for deciding whether a conditional or unconditional
    mutual info is said to be close to zero (independence) or not (
    dependence). The error in a data entropy is on the order of ln(n+1)
    - ln(n) \approx 1/n where n is the number of samples so 5/n is a
    good default value for alpha.
verbose : bool
    True for this prints a running commentary to console
vtx_to_MB : dict[str, list[str]]
    A dictionary mapping each vertex to a list of the vertices in its
    Markov Blanket. (The MB of a node consists of its parents, children
    and children's parents, aka spouses).
vtx_to_nbors : dict[str, list[str]]
    a dictionary mapping each vertex to a list of its neighbors. The
    literature also calls the set of neighbors of a vertex its PC (
    parents-children) set.
vtx_to_parents : dict[str, list[str]]
    dictionary mapping each vertex to a list of its parents's names

min_sam_per_cell : int
    The threshold for there to be sufficient data (for meaningful
    prediction of an element of the MB of a vertex) is proportional to
    this number according to t-test of statistics. Usually taken to be 5.

Constructor & Destructor Documentation

def learning.MB_fast_IAMB_Lner.MB_fast_IAMB_Lner.__init__ (   self,
  states_df,
  alpha,
  min_sam_per_cell = 5,
  verbose = False,
  vtx_to_states = None,
  learn_later = False 
)
Constructor

Parameters
----------
states_df : pandas.DataFrame
alpha : float
min_sam_per_cell : int
verbose : bool
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
learn_later : bool
    False if you want to call the function learn_struc() inside the
    constructor. True if not.

Returns
-------
None

Member Function Documentation

def learning.MB_fast_IAMB_Lner.MB_fast_IAMB_Lner.find_MB (   self,
  vtx = None 
)
This function finds the MB of vtx and stores it inside vtx_to_MB[
vtx]. If vtx=None, then it will find the MB of all the vertices of
the graph.

Parameters
----------
vtx : str

Returns
-------
None

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