|
def | __init__ (self, states_df, vtx_to_states=None) |
|
def | prune_ew_list (self, mi_array, ew_list) |
|
def | do_if_both_nds_old (self, j, k, nd_ids) |
|
def | __init__ (self, states_df, vtx_to_states=None) |
|
def | learn_net_struc (self) |
|
def | prune_ew_list (self, mi_array, ew_list) |
|
def | do_if_both_nds_old (self, j, k, nd_ids) |
|
def | __init__ (self, is_quantum, states_df, vtx_to_states=None) |
|
def | fill_bnet_with_parents (self, vtx_to_parents) |
|
The Aracne network was first used in Ref. 1. It is a simple variation of
the old Chow Liu Tree. It differs from the CL tree in 2 ways. We
implement those two differences by subclassing the ChowLiuTree class,
but overriding two of its methods.
As with CL trees, each edge is assigned the mutual info of its two
endpoint nodes.
Whereas CL trees use all edges, no matter how small their mutual info
is, arcane considers all triangles with nodes as vertices, and throws
away the edge of the triangle with the smallest mutual info. Then it
points the arrows in the 2 remaining edges so that the 2 arrows point in
the same direction, going from the edge with the larger to the edge with
the smaller mutual info. If the vertices of the triangle are x, y, z,
this is all consistent with the data processing inequality (see Cover
Thomas book on Info theory) H(x : z) <= min [ H(x:y), H(y:z) ] for the
bnet x->y->z
Whereas CL trees are trees, arcane graphs can have loops. This is
achieved by allowing connections between 2 nodes that have been used
before, something CL trees do not allow.
References
----------
1. ARACNE: an algorithm for the reconstruction of gene regulatory
networks in a mammalian cellular context, by Margolin AA1, Nemenman I,
Basso K, Wiggins C, Stolovitzky G, Dalla Favera R, Califano A. (BMC
Bioinformatics. 2006 Mar 20;7 Suppl 1:S7)
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.
def learning.AracneLner.AracneLner.prune_ew_list |
( |
|
self, |
|
|
|
mi_array, |
|
|
|
ew_list |
|
) |
| |
This function takes as input an ew_list and returns that list pruned
(i.e., with some of its items removed). Items are removed by
considering vtx triangles i,j,k and removing one of the 3 edges of
the triangle, the one with smallest mutual info.
Parameters
----------
mi_array : numpy.array
a square array with the mutual information of nodes i and j at
position (i, j) with i < j.
ew_list : list[tuple(int, int, float)]
an edge-weight (ew) list. An ew is a 3-tuple ( i, j, weight)
representing an arrow i->j for ints i, j denoting vertices,
with weight w equal to the mutual info between the two endpoints
i, j of the arrow.
Returns
-------
list[tuple(int, int, float)]