/** * for testing the class * * @param argv the commandline parameters */ static public void main(String[] argv) { try { BayesNet b = new BayesNet(); b.setSearchAlgorithm(new ICSSearchAlgorithm()); Instances instances = new Instances(new FileReader( "C:\\eclipse\\workspace\\weka\\data\\contact-lenses.arff")); instances.setClassIndex(instances.numAttributes() - 1); b.buildClassifier(instances); System.out.println(b.toString()); } catch (Exception e) { e.printStackTrace(); } } // main
/** * for testing the class * * @param argv the commandline parameters */ static public void main(String[] argv) { try { BayesNet b = new BayesNet(); b.setSearchAlgorithm(new ICSSearchAlgorithm()); Instances instances = new Instances(new FileReader( "C:\\eclipse\\workspace\\weka\\data\\contact-lenses.arff")); instances.setClassIndex(instances.numAttributes() - 1); b.buildClassifier(instances); System.out.println(b.toString()); } catch (Exception e) { e.printStackTrace(); } } // main
setSearchAlgorithm((SearchAlgorithm) Utils.forName(SearchAlgorithm.class, searchAlgorithmName, partitionOptions(options))); } else { setSearchAlgorithm(new K2());
setSearchAlgorithm((SearchAlgorithm) Utils.forName(SearchAlgorithm.class, searchAlgorithmName, partitionOptions(options))); } else { setSearchAlgorithm(new K2());
oSearchAlgorithm.setInitAsNaiveBayes(false); oSearchAlgorithm.setMaxNrOfParents(0); EmptyNet.setSearchAlgorithm(oSearchAlgorithm); EmptyNet.buildClassifier(instances); oSearchAlgorithm.setInitAsNaiveBayes(true); oSearchAlgorithm.setMaxNrOfParents(1); NBNet.setSearchAlgorithm(oSearchAlgorithm); NBNet.buildClassifier(instances);
oSearchAlgorithm.setInitAsNaiveBayes(false); oSearchAlgorithm.setMaxNrOfParents(0); EmptyNet.setSearchAlgorithm(oSearchAlgorithm); EmptyNet.buildClassifier(instances); oSearchAlgorithm.setInitAsNaiveBayes(true); oSearchAlgorithm.setMaxNrOfParents(1); NBNet.setSearchAlgorithm(oSearchAlgorithm); NBNet.buildClassifier(instances);
oSearchAlgorithm.setInitAsNaiveBayes(false); oSearchAlgorithm.setMaxNrOfParents(0); EmptyNet.setSearchAlgorithm(oSearchAlgorithm); EmptyNet.buildClassifier(instances); oSearchAlgorithm.setInitAsNaiveBayes(true); oSearchAlgorithm.setMaxNrOfParents(1); NBNet.setSearchAlgorithm(oSearchAlgorithm); NBNet.buildClassifier(instances);
oSearchAlgorithm.setInitAsNaiveBayes(false); oSearchAlgorithm.setMaxNrOfParents(0); EmptyNet.setSearchAlgorithm(oSearchAlgorithm); EmptyNet.buildClassifier(instances); oSearchAlgorithm.setInitAsNaiveBayes(true); oSearchAlgorithm.setMaxNrOfParents(1); NBNet.setSearchAlgorithm(oSearchAlgorithm); NBNet.buildClassifier(instances);