Package weka.gui.visualize

Examples of weka.gui.visualize.ThresholdVisualizePanel


    ThresholdCurve tc = new ThresholdCurve();
    int classIndex = 0;
    Instances curve = tc.getCurve(eval.predictions(), classIndex);

    // plot curve
    ThresholdVisualizePanel tvp = new ThresholdVisualizePanel();
    tvp.setROCString("(Area under ROC = " +
  Utils.doubleToString(ThresholdCurve.getROCArea(curve), 4) + ")");
    tvp.setName(curve.relationName());
    PlotData2D plotdata = new PlotData2D(curve);
    plotdata.setPlotName(curve.relationName());
    plotdata.addInstanceNumberAttribute();
    // specify which points are connected
    boolean[] cp = new boolean[curve.numInstances()];
    for (int n = 1; n < cp.length; n++)
      cp[n] = true;
        try {
            plotdata.setConnectPoints(cp);
            tvp.addPlot(plotdata);
        } catch (Exception ex) {
            System.out.println("PlotFail");
        }


    // display curve
    final JFrame jf = new JFrame("WEKA ROC: " + tvp.getName());
    jf.setSize(500,400);
    jf.getContentPane().setLayout(new BorderLayout());
    jf.getContentPane().add(tvp, BorderLayout.CENTER);
    jf.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    jf.setVisible(true);
View Full Code Here

TOP

Related Classes of weka.gui.visualize.ThresholdVisualizePanel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.