Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/380.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 用wekaapi构建bayes网络_Java_Weka_Bayesian Networks - Fatal编程技术网

Java 用wekaapi构建bayes网络

Java 用wekaapi构建bayes网络,java,weka,bayesian-networks,Java,Weka,Bayesian Networks,我想使用现有数据集构建贝叶斯网络(或贝叶斯网络),有人有通过WEKA API学习贝叶斯网络的演示代码吗===================== //K2学习者=新K2();//集合搜索算法1 //MultiNomialBMAEstimator estimator = new MultiNomialBMAEstimator(); //set estimator 1 //estimator.setUseK2Prior(true); //BMAEstimator estim

我想使用现有数据集构建贝叶斯网络(或贝叶斯网络),有人有通过WEKA API学习贝叶斯网络的演示代码吗===================== //K2学习者=新K2();//集合搜索算法1

    //MultiNomialBMAEstimator estimator = new MultiNomialBMAEstimator(); //set estimator 1
    //estimator.setUseK2Prior(true);

    //BMAEstimator estimator = new BMAEstimator(); //set estimator 2

    SimpleEstimator estimator = new SimpleEstimator(); //set estimator 3
    SimulatedAnnealing learner = new SimulatedAnnealing(); // set search algorithm 2    

    Evaluation evaluation = new Evaluation(ins);

    EditableBayesNet bnBayesNet = new EditableBayesNet(ins);
    bnBayesNet.initStructure();

    learner.buildStructure(bnBayesNet, ins);
    estimator.estimateCPTs(bnBayesNet);

    //=================== visualize the bayes net ====================
    GraphVisualizer graphVisualizer = new GraphVisualizer();
    graphVisualizer.readBIF(bnBayesNet.graph());

    final JFrame jFrame = new JFrame("Weka Classifier Graph Visualizer: Bayes net");
    jFrame.setSize(500, 400);
    jFrame.getContentPane().setLayout(new BorderLayout());
    jFrame.getContentPane().add(graphVisualizer, BorderLayout.CENTER);
    jFrame.addWindowFocusListener(new WindowAdapter() {
        public void windowClosing(WindowEvent e) {
            jFrame.dispose();               
        }
    });
    jFrame.setVisible(true);
    graphVisualizer.layoutGraph();