![]() |
Quantum Fog
0.9.3
|


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 | |
| bnet | |
| ord_nodes | |
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) |
TreeAugNaiveBayesLner (Tree Augmented Naive Bayes Learner) is a simple
improvement of the Naive Bayes algorithm that combines Naive Bayes with
Chow Liu Trees.
Whereas in Naive Bayes, the only arrows are those emanating from a
target node to all other nodes, TAN Bayes first builds a CL tree from
all nodes except the target one, and then it adds arrows from the target
node to all other nodes. The idea is that under Naive Bayes all
non-target nodes are independent if the target is held fixed. In the TAN
Bayes graph, the non-target nodes are given a chance to be correlated,
even if the target is held fixed.
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
target vertex. This node has arrows pointing to all other nodes. | def learning.TreeAugNaiveBayesLner.TreeAugNaiveBayesLner.__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
-------
None
| def learning.TreeAugNaiveBayesLner.TreeAugNaiveBayesLner.learn_net_struc | ( | self | ) |
This function learns a graph structure (a hybrid of a Naive Bayes tree and a Chow Liu tree) from the data and stores what it learns in self.bnet. Returns ------- None
1.8.11