BayesNet EmptyNet = new BayesNet();
K2 oSearchAlgorithm = new K2();
oSearchAlgorithm.setInitAsNaiveBayes(false);
oSearchAlgorithm.setMaxNrOfParents(0);
EmptyNet.setSearchAlgorithm(oSearchAlgorithm);
EmptyNet.buildClassifier(instances);
BayesNet NBNet = new BayesNet();
oSearchAlgorithm.setInitAsNaiveBayes(true);
oSearchAlgorithm.setMaxNrOfParents(1);
NBNet.setSearchAlgorithm(oSearchAlgorithm);