File Exchange

image thumbnail

Structure Learning Package for Bayes Net Toolbox

version (2.02 MB) by Olivier Francois
Structure Learning methods for Bayesian Networks


Updated 09 Jun 2009

View Version History

View License

Learning methods for Bayesian Networks and statistical tools

Cite As

Olivier Francois (2021). Structure Learning Package for Bayes Net Toolbox (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (23)

Olivier Francois

Thank you for supporting this work.
This Matlab central package has no longer been updated since 2008.

Nevertheless you should download updated version at :

Best regards.

vajendra kumar

and there are no files for ''compute_approx_ess'' in BNT matlab. if you could help me with this problem, it would be a great help.

vajendra kumar

dear sir, i am using ''learn_struct_EM'' command but there are no ''multiply_one_marginal.m'' is available, there are .c .dll .mexa64 and .mexglx but no .m file so i am getting undefined variable ''multiply_one_marginal''

Welf Löwe

Dear Olivier, thanks for the contribution and I'm happy to test it now. One first remark: I managed to extract the tar.gz file, but you might want to consider to not include absolute paths in the distribution.
Kind regards,

Zeyu Pan

DAN jiang

Dear Olivier,
I 've used your package to train my bayes network's structure, SEM is ok,but when i tried ges_em,as there is 24 nodes in my network,the memory run out(my computer work environment : Win7 64bit 128ssd 8GB RAM ).
is it beacause there are too many nodes?
Furthermore, I tried mwst_em,for my matlab is 2010b 64bit,so there is something wrong after i use the mex function to mex the init_pot.c (in the document of bnt\BNT\inference\static@jtree_sparse_inf_engine),someone says that it is because that in 64bit matlab ,when we use mex,there is something different between the"int"&"mwIndex".Could help me about these problem?
At last ,I used your Asia2000 to run the ges_em ,with random initialdag,zeros(1,N),and the answer dag is:all the arc conect with one nodes. Am I wrong? Should I define a dag &cpt before i run ges_em?
Excuse me for all the inconvenience I have brought to you
I would really appericiate your help with this problem.

Best Regards

Waiting for you help,thanks!

DAN jiang

I've tried GESEM、MWST_EM and Gibbs_samlpling,but there is 24 nodes in my bnet,so GESEM run out of computer is 8GB RAM by the way.
About MWST_EM,there is something wrong with the jnt_sparse_inf_engine,though I mex it to .mewx64,matlab still tell me : ??? Error using ==> init_pot
Out of memory. Type HELP MEMORY for your options.

So,how can I get your email Address? My email or
Er,my english is not very goood..Excuse me for all the inconvenience I have brought to you
I would really appericiate your help with this problem.

Best Regards

Olivier Francois

Dear Users,

this works was done around 1997-2005,
so the graphical interface doesn't work anymore with newer version of Matlab (>2015b), as well as test functions that has graphical outputs.

Nevertheless, it might work for learning task.
If you want some support, write me a email and I will help you and send files (as multiply_one_marginal) if needed.

DAN jiang

Dear Olivier
I have the same problem with Omid.....
Undefined function 'multiply_one_marginal' for input arguments of type 'struct'" when I tried to use
I would really appericiate your help with this problem.

Best Regards



Also, all of the test_sem functions get the same error.


Dear Olivier

I've tried to use "learn_struct_EM(bnet, samplesM, max_loop)" function, but I get the following error:
"Undefined function 'multiply_one_marginal' for input arguments of type 'struct'"
However, the inpute for 'multiply_one_marginal' should be a single node's marginal, which is a structure.

I'm using Matlab R2013a version.

I would really appericiate your help with this problem.

Best Regards


Olivier Francois

Dear Pablo,

thank you for supporting our work.

I'm so sorry for that remaining mistake.

Du to changes, each time you call
you must pass data' (transposed) instead of simply data.

Make the change on lines 77, 292, 309, 413, 420, 495, 605 and 626.

Best regards.


Dear Olivier,

I'm trying to work with the function learn_struct_bnpc and it always returns a fully independent bayes network. I used your 3 test_bnpc files provided with your code and some other data in your repository and none of them can manage to learn a structure.

I appreciate your help to find what went wrong.

Many thanks


Thank you, for the answer

Olivier Francois

Dear Pedro,

there is a typo here.

The input 'app' is the same as 'data' and is the learning dataset where
data(n,l) is supposed to be the l-th observed value of the n-th node/variable.

Note that the dataset is supposed the be passed transposed (than usual for most user) in all SLP function (and BNT also).

The Tree Augmented Bayesian Network classifier is described in the literature, for instance in "Learning the Tree Augmented Naive Bayes Classifier from incomplete datasets (O.C.H. François, P. Leray)in prooceddings of the third European Workshop on Probabilistic Graphical Models, PGM'06, Prague, Czech Republic, 2006"

Kind Regards.


Hi, could you please tell me more about the learn_struct_tan function, right now it just says: learn_struct_tan(app, class, root, node_sizes)

Input :
data(i,m) is the value of node i in case m
class_node is the class node
root is the root node of the tree part of the dag (must be different from the class node)
node_sizes = 1 if gaussian node,
scoring_fn = 'bic' (default value) or 'mutual_info'

So what is the data and the app, and why it says the node(i,m)?


thank you for helping



OCH Francois

Thank you for supporting our work.
You could find further information at those websites: (use automated translation if needed) (for up-to-date versions)

Zhaowen Wang

Exactly what I'm looking for

MATLAB Release Compatibility
Created with R12.1
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!