Example usage for weka.gui.beans AttributeSummarizer setGridWidth

List of usage examples for weka.gui.beans AttributeSummarizer setGridWidth

Introduction

In this page you can find the example usage for weka.gui.beans AttributeSummarizer setGridWidth.

Prototype

public void setGridWidth(int gw) 

Source Link

Document

Set the width of the grid of plots

Usage

From source file:lu.lippmann.cdb.datasetview.tabs.AttributesSummaryTabView.java

License:Open Source License

/**
 * {@inheritDoc}/*from www.  j  a v  a 2s  .co  m*/
 */
@Override
public void update0(final Instances dataSet) throws Exception {
    final int numAttr = dataSet.numAttributes();

    final JTabbedPane tabbedPane = new JTabbedPane();

    this.as.setGridWidth(Math.min(3, numAttr));
    this.as.setColoringIndex(dataSet.classIndex());
    this.as.setInstances(dataSet);
    tabbedPane.addTab("All", this.as);

    for (int i = 0; i < numAttr; i++) {
        final Instances nds = WekaDataProcessingUtil.buildFilteredByAttributesDataSet(dataSet, new int[] { i });
        final AttributeSummarizer as0 = new AttributeSummarizer();
        as0.setGridWidth(1);
        as0.setColoringIndex(nds.classIndex());
        as0.setInstances(nds);
        tabbedPane.addTab(dataSet.attribute(i).name(), as0);
    }

    this.jxp.removeAll();
    this.jxp.add(tabbedPane, BorderLayout.CENTER);
    this.jxp.repaint();
}