Code covered by the BSD License  

Highlights from
K2 algorithm for learning DAG structure in Bayesian network

5.0

5.0 | 2 ratings Rate this file 36 Downloads (last 30 days) File Size: 9.84 KB File ID: #23273
image thumbnail

K2 algorithm for learning DAG structure in Bayesian network

by

 

12 Mar 2009 (Updated )

This is the code of Cooper's K2 algorithm proposed in 1992, quick and convenient for using.

| Watch this File

File Information
Description

    K2 algorithm is the most famous score-based algorithm in Bayesian netowrk in the last two decades. Specifically, it recovers the underlying distribution in the form of DAG efficiently. For details, please refer to Cooper's published paper[1]
    
    Please start from "ControlCentor.m", here is a simple example for understanding how to use our code.

    If there is any question, please let me know, i will help you as soon as possible.

     I use rewritten the K2 by mex programming, if you know how to compile it, please try K2.c because this code is able to handle the variables as large as 1000 variables, much efficient. It's tested under linux both 32-bit and 64-bit.

[1] G. Cooper and E. Herskovitz, A Bayesian method for the induction of probabilistic networks from data, Machine Learning
9 (1992), 330–347.

If you use this code, please cite our paper:

Bielza, C., Li, G. & Larrañaga, P. (2011). Multi-Dimensional Classification with Bayesian Networks. International Journal of Approximate Reasoning, 52, 705-727.

MATLAB release MATLAB 7.6 (R2008a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (4)
01 Dec 2013 fasilkom

I'm studying about learning temporal node bayesian networks. From the paper i got before, i get that ordering is doing by partial set of ordering, for example we order {1}, {3 5 6} and {2 4}. In your code i get that ordering is given in one time (1 3 5 6 2 4). I've been trying to make a modification in your code but i failed. How can i modif it? Is there any suggestion? Thanks

06 Jun 2013 Guangdi Li

Dear Pedro:

I advise you to use software Graphviz, or draw in photoshop, or powerpoint.

Regarding the mapping of nodes in matlab, it takes extra effort to make it beautiful. You can refer to my paper: Bielza, C., Li, G. & Larrañaga, P. (2011). Multi-Dimensional Classification with Bayesian Networks. International Journal of Approximate Reasoning, 52, 705-727.

thanks for your interest!

06 Jun 2013 Pedro

Hi, is there a way to name the nodes? Not having them show like node 1, etc. Thanks

28 Mar 2009 Guangdi Li

There is one file named 'DimensionRangeValue.m' is missing, I am sorry for any inconvenience of you working. The updated version will be published in next week (March 20) after Matlab Center checks it. Enjoying you using my codes.

Updates
28 Mar 2009

One file is missing, sorry, I add it again.

17 Jun 2009

I improve the efficiency of this algorithm again.

27 Jun 2009

Update the code to output the K2 score upon each node

05 Aug 2009

improve the efficiency of code by mex programming.

06 Jun 2013

update description

Contact us