本文整理汇总了Java中com.rapidminer.datatable.SimpleDataTableRow类的典型用法代码示例。如果您正苦于以下问题:Java SimpleDataTableRow类的具体用法?Java SimpleDataTableRow怎么用?Java SimpleDataTableRow使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SimpleDataTableRow类属于com.rapidminer.datatable包,在下文中一共展示了SimpleDataTableRow类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: fillDataTable
import com.rapidminer.datatable.SimpleDataTableRow; //导入依赖的package包/类
public int fillDataTable(SimpleDataTable dataTable, List<AggregationIndividual> pop) {
dataTable.clear();
int numberOfCriteria = 0;
for (int i = 0; i < pop.size(); i++) {
StringBuffer id = new StringBuffer(i + " (");
PerformanceVector current = pop.get(i).getPerformance();
numberOfCriteria = Math.max(numberOfCriteria, current.getSize());
double[] data = new double[current.getSize()];
for (int d = 0; d < data.length; d++) {
data[d] = current.getCriterion(d).getFitness();
if (d != 0) {
id.append(", ");
}
id.append(Tools.formatNumber(data[d]));
}
id.append(")");
dataTable.add(new SimpleDataTableRow(data, id.toString()));
}
return numberOfCriteria;
}
示例2: startVisualization
import com.rapidminer.datatable.SimpleDataTableRow; //导入依赖的package包/类
@Override
public void startVisualization(Object id) {
double[] weights = lastPopulation.get(id);
SimpleDataTable dataTable = new SimpleDataTable("Attribute Weights", new String[] { "Attribute", "Weight" });
int a = 0;
for (Attribute attribute : exampleSet.getAttributes()) {
dataTable
.add(new SimpleDataTableRow(new double[] { dataTable.mapString(0, attribute.getName()), weights[a++] }));
}
Component visualizationComponent = new DataTableViewer(dataTable);
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
frame.getContentPane().setLayout(new BorderLayout());
frame.getContentPane().add(new ExtendedJScrollPane(visualizationComponent), BorderLayout.CENTER);
frame.setSize(600, 400);
frame.setLocationRelativeTo(null);
frame.setVisible(true);
}
示例3: fillDataTable
import com.rapidminer.datatable.SimpleDataTableRow; //导入依赖的package包/类
public int fillDataTable(SimpleDataTable dataTable, Population pop) {
dataTable.clear();
int numberOfCriteria = 0;
for (int i = 0; i < pop.getNumberOfIndividuals(); i++) {
StringBuffer id = new StringBuffer(i + " (");
double[] currentFitness = pop.get(i).getFitnessValues();
numberOfCriteria = Math.max(numberOfCriteria, currentFitness.length);
double[] data = new double[currentFitness.length];
for (int d = 0; d < data.length; d++) {
data[d] = currentFitness[d];
if (d != 0) {
id.append(", ");
}
id.append(Tools.formatNumber(data[d]));
}
id.append(")");
dataTable.add(new SimpleDataTableRow(data, id.toString()));
}
return numberOfCriteria;
}
示例4: getPlotter
import com.rapidminer.datatable.SimpleDataTableRow; //导入依赖的package包/类
private Plotter getPlotter(Object renderable) {
SVDModel model = (SVDModel) renderable;
double[] cumulativeVariance = new double[model.getNumberOfComponents()];
for (int i = 0; i < cumulativeVariance.length; i++) {
cumulativeVariance[i] = model.getCumulativeSingularValue(i);
}
DataTable dataTable = new SimpleDataTable("Cumulative Proportion of Singular Values", new String[] {
"Singular Value Vectors", "Cumulative Proportion of Singular Values" });
dataTable.add(new SimpleDataTableRow(new double[] { 0.0d, 0.0d }));
for (int i = 0; i < cumulativeVariance.length; i++) {
dataTable.add(new SimpleDataTableRow(new double[] { i + 1, cumulativeVariance[i] }));
}
PlotterConfigurationModel settings = new PlotterConfigurationModel(
PlotterConfigurationModel.WEIGHT_PLOTTER_SELECTION, dataTable);
settings.setPlotter(PlotterConfigurationModel.LINES_PLOT);
Plotter plotter = settings.getPlotter();
settings.setAxis(0, 0);
settings.enablePlotColumn(1);
return plotter;
}
示例5: getPlotter
import com.rapidminer.datatable.SimpleDataTableRow; //导入依赖的package包/类
private Plotter getPlotter(Object renderable) {
AbstractEigenvectorModel model = (AbstractEigenvectorModel) renderable;
double[] cumulativeVariance = model.getCumulativeVariance();
DataTable dataTable = new SimpleDataTable("Cumulative Proportion of Variance", new String[] {
"Principal Components", "Cumulative Proportion of Variance" });
dataTable.add(new SimpleDataTableRow(new double[] { 0.0d, 0.0d }));
for (int i = 0; i < cumulativeVariance.length; i++) {
dataTable.add(new SimpleDataTableRow(new double[] { i + 1, cumulativeVariance[i] }));
}
PlotterConfigurationModel settings = new PlotterConfigurationModel(
PlotterConfigurationModel.WEIGHT_PLOTTER_SELECTION, dataTable);
settings.setPlotter(PlotterConfigurationModel.LINES_PLOT);
Plotter plotter = settings.getPlotter();
settings.setAxis(0, 0);
settings.enablePlotColumn(1);
return plotter;
}
示例6: createCentroidPlotter
import com.rapidminer.datatable.SimpleDataTableRow; //导入依赖的package包/类
private Plotter createCentroidPlotter(CentroidClusterModel cm, int width, int height) {
String[] dimensionNames = cm.getAttributeNames();
String[] columnNames = new String[dimensionNames.length + 1];
System.arraycopy(dimensionNames, 0, columnNames, 0, dimensionNames.length);
columnNames[columnNames.length - 1] = "Cluster";
SimpleDataTable dataTable = new SimpleDataTable("Centroid Positions", columnNames);
for (int i = 0; i < cm.getNumberOfClusters(); i++) {
double[] centroidValues = cm.getCentroidCoordinates(i);
String clusterName = cm.getCluster(i).getClusterId() + "";
double[] values = new double[centroidValues.length + 1];
System.arraycopy(centroidValues, 0, values, 0, centroidValues.length);
values[values.length - 1] = dataTable.mapString(values.length - 1, clusterName);
dataTable.add(new SimpleDataTableRow(values));
}
PlotterConfigurationModel settings = new PlotterConfigurationModel(PlotterConfigurationModel.PARALLEL_PLOT,
dataTable);
Plotter plotter = settings.getPlotter();
settings.setParameterAsString(PlotterAdapter.PARAMETER_PLOT_COLUMN, columnNames[columnNames.length - 1]);
settings.setParameterAsBoolean(LocalNormalizationPlotterAdapter.PARAMETER_LOCAL_NORMALIZATION, false);
settings.setParameterAsBoolean(LabelRotatingPlotterAdapter.PARAMETER_ROTATE_LABELS, true);
plotter.getPlotter().setSize(width, height);
return plotter;
}
示例7: createLiftChartPlot
import com.rapidminer.datatable.SimpleDataTableRow; //导入依赖的package包/类
/** Creates a dialog containing a plotter for a given list of ROC data points. */
public void createLiftChartPlot(List<double[]> data) {
// create data table
DataTable dataTable = new SimpleDataTable("Lift Chart", new String[] { "Fraction", "Lift" });
int pointCounter = 0;
int eachPoint = Math.max(1, (int) Math.round((double) data.size() / (double) MAX_LIFT_POINTS));
for (double[] point : data) {
if (pointCounter == 0 || pointCounter % eachPoint == 0 || pointCounter == data.size() - 1) {
double fraction = point[0];
double lift = point[1];
if (Double.isNaN(lift)) {
lift = this.maxLift;
}
dataTable.add(new SimpleDataTableRow(new double[] { fraction, lift }));
}
pointCounter++;
}
// create plotter
SimplePlotterDialog plotter = new SimplePlotterDialog(dataTable);
plotter.setXAxis(0);
plotter.plotColumn(1, true);
// plotter.setDrawRange(0.0d, 1.0d, 0.0d, 1.0d);
plotter.setVisible(true);
}
示例8: fillDataTable
import com.rapidminer.datatable.SimpleDataTableRow; //导入依赖的package包/类
public int fillDataTable(SimpleDataTable dataTable, List<AggregationIndividual> pop) {
dataTable.clear();
int numberOfCriteria = 0;
for (int i = 0; i < pop.size(); i++) {
StringBuffer id = new StringBuffer(i + " (");
PerformanceVector current = pop.get(i).getPerformance();
numberOfCriteria = Math.max(numberOfCriteria, current.getSize());
double[] data = new double[current.getSize()];
for (int d = 0; d < data.length; d++) {
data[d] = current.getCriterion(d).getFitness();
if (d != 0)
id.append(", ");
id.append(Tools.formatNumber(data[d]));
}
id.append(")");
dataTable.add(new SimpleDataTableRow(data, id.toString()));
}
return numberOfCriteria;
}
示例9: startVisualization
import com.rapidminer.datatable.SimpleDataTableRow; //导入依赖的package包/类
public void startVisualization(Object id) {
double[] weights = lastPopulation.get(id);
SimpleDataTable dataTable = new SimpleDataTable("Attribute Weights", new String[] { "Attribute", "Weight" });
int a = 0;
for (Attribute attribute : exampleSet.getAttributes()) {
dataTable.add(new SimpleDataTableRow(new double[] { dataTable.mapString(0, attribute.getName()), weights[a++] } ));
}
Component visualizationComponent = new DataTableViewer(dataTable);
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
frame.getContentPane().setLayout(new BorderLayout());
frame.getContentPane().add(new ExtendedJScrollPane(visualizationComponent), BorderLayout.CENTER);
frame.setSize(600, 400);
frame.setLocationRelativeTo(null);
frame.setVisible(true);
}
示例10: createDataTable
import com.rapidminer.datatable.SimpleDataTableRow; //导入依赖的package包/类
private DataTable createDataTable(ROCData data, boolean showSlope, boolean showThresholds) {
DataTable dataTable = new SimpleDataTable("ROC Plot", new String[] { "FP/N", "TP/P", "Slope", "Threshold" });
Iterator<ROCPoint> i = data.iterator();
int pointCounter = 0;
int eachPoint = Math.max(1, (int) Math.round((double) data.getNumberOfPoints() / (double) MAX_ROC_POINTS));
while (i.hasNext()) {
ROCPoint point = i.next();
if ((pointCounter == 0) || ((pointCounter % eachPoint) == 0) || (!i.hasNext())) { // draw only MAX_ROC_POINTS points
double fpRate = point.getFalsePositives() / data.getTotalNegatives();
double tpRate = point.getTruePositives() / data.getTotalPositives();
double threshold = point.getConfidence();
dataTable.add(new SimpleDataTableRow(new double[] {
fpRate, // x
tpRate, // y1
data.getBestIsometricsTPValue() + (fpRate * slope * (data.getTotalNegatives() / data.getTotalPositives())), // y2: slope
threshold // y3: threshold or confidence
}));
}
pointCounter++;
}
return dataTable;
}
示例11: fillDataTable
import com.rapidminer.datatable.SimpleDataTableRow; //导入依赖的package包/类
public int fillDataTable(SimpleDataTable dataTable, Population pop) {
dataTable.clear();
int numberOfCriteria = 0;
for (int i = 0; i < pop.getNumberOfIndividuals(); i++) {
StringBuffer id = new StringBuffer(i + " (");
double[] currentFitness = pop.get(i).getFitnessValues();
numberOfCriteria = Math.max(numberOfCriteria, currentFitness.length);
double[] data = new double[currentFitness.length];
for (int d = 0; d < data.length; d++) {
data[d] = currentFitness[d];
if (d != 0)
id.append(", ");
id.append(Tools.formatNumber(data[d]));
}
id.append(")");
dataTable.add(new SimpleDataTableRow(data, id.toString()));
}
return numberOfCriteria;
}
示例12: createLiftChartPlot
import com.rapidminer.datatable.SimpleDataTableRow; //导入依赖的package包/类
/** Creates a dialog containing a plotter for a given list of ROC data points. */
public void createLiftChartPlot(List<double[]> data) {
// create data table
DataTable dataTable = new SimpleDataTable("Lift Chart", new String[] { "Fraction", "Lift" });
Iterator i = data.iterator();
int pointCounter = 0;
int eachPoint = Math.max(1, (int) Math.round((double) data.size() / (double) MAX_LIFT_POINTS));
while (i.hasNext()) {
double[] point = (double[]) i.next();
if ((pointCounter == 0) || ((pointCounter % eachPoint) == 0) || (!i.hasNext())) {
double fraction = point[0];
double lift = point[1];
if (Double.isNaN(lift))
lift = this.maxLift;
dataTable.add(new SimpleDataTableRow(new double[] { fraction, lift }));
}
pointCounter++;
}
// create plotter
SimplePlotterDialog plotter = new SimplePlotterDialog(dataTable);
plotter.setXAxis(0);
plotter.plotColumn(1, true);
//plotter.setDrawRange(0.0d, 1.0d, 0.0d, 1.0d);
plotter.setVisible(true);
}
示例13: getPlotter
import com.rapidminer.datatable.SimpleDataTableRow; //导入依赖的package包/类
private Plotter getPlotter(Object renderable) {
SVDModel model = (SVDModel) renderable;
double[] cumulativeVariance = new double[model.getNumberOfComponents()];
for (int i = 0; i < cumulativeVariance.length; i++) {
cumulativeVariance[i] = model.getCumulativeSingularValue(i);
}
DataTable dataTable = new SimpleDataTable("Cumulative Proportion of Singular Values", new String[] { "Singular Value Vectors", "Cumulative Proportion of Singular Values" });
dataTable.add(new SimpleDataTableRow(new double[] { 0.0d, 0.0d }));
for (int i = 0; i < cumulativeVariance.length; i++) {
dataTable.add(new SimpleDataTableRow(new double[] { i + 1, cumulativeVariance[i] }));
}
PlotterConfigurationModel settings = new PlotterConfigurationModel(PlotterConfigurationModel.WEIGHT_PLOTTER_SELECTION, dataTable);
settings.setPlotter(PlotterConfigurationModel.LINES_PLOT);
Plotter plotter = settings.getPlotter();
settings.setAxis(0, 0);
settings.enablePlotColumn(1);
return plotter;
}
示例14: getPlotter
import com.rapidminer.datatable.SimpleDataTableRow; //导入依赖的package包/类
private Plotter getPlotter(Object renderable) {
AbstractEigenvectorModel model = (AbstractEigenvectorModel) renderable;
double[] cumulativeVariance = model.getCumulativeVariance();
DataTable dataTable = new SimpleDataTable("Cumulative Proportion of Variance", new String[] { "Principal Components", "Cumulative Proportion of Variance" });
dataTable.add(new SimpleDataTableRow(new double[] { 0.0d, 0.0d }));
for (int i = 0; i < cumulativeVariance.length; i++) {
dataTable.add(new SimpleDataTableRow(new double[] { i + 1, cumulativeVariance[i] }));
}
PlotterConfigurationModel settings = new PlotterConfigurationModel(PlotterConfigurationModel.WEIGHT_PLOTTER_SELECTION, dataTable);
settings.setPlotter(PlotterConfigurationModel.LINES_PLOT);
Plotter plotter = settings.getPlotter();
settings.setAxis(0, 0);
settings.enablePlotColumn(1);
return plotter;
}
示例15: createCentroidPlotter
import com.rapidminer.datatable.SimpleDataTableRow; //导入依赖的package包/类
private Plotter createCentroidPlotter(CentroidClusterModel cm, int width, int height) {
String[] dimensionNames = cm.getAttributeNames();
String[] columnNames = new String[dimensionNames.length + 1];
System.arraycopy(dimensionNames, 0, columnNames, 0, dimensionNames.length);
columnNames[columnNames.length - 1] = "Cluster";
SimpleDataTable dataTable = new SimpleDataTable("Centroid Positions", columnNames);
for (int i = 0; i < cm.getNumberOfClusters(); i++) {
double[] centroidValues = cm.getCentroidCoordinates(i);
String clusterName = cm.getCluster(i).getClusterId() + "";
double[] values = new double[centroidValues.length + 1];
System.arraycopy(centroidValues, 0, values, 0, centroidValues.length);
values[values.length - 1] = dataTable.mapString(values.length - 1, clusterName);
dataTable.add(new SimpleDataTableRow(values));
}
PlotterConfigurationModel settings = new PlotterConfigurationModel(PlotterConfigurationModel.PARALLEL_PLOT, dataTable);
Plotter plotter = settings.getPlotter();
settings.setParameterAsString(ParallelPlotter2.PARAMETER_PLOT_COLUMN, columnNames[columnNames.length - 1]);
settings.setParameterAsBoolean(ParallelPlotter2.PARAMETER_LOCAL_NORMALIZATION, false);
settings.setParameterAsBoolean(ParallelPlotter2.PARAMETER_ROTATE_LABELS, true);
plotter.getPlotter().setSize(width, height);
return plotter;
}