当前位置: 首页>>代码示例>>Java>>正文


Java SimpleDataTableRow类代码示例

本文整理汇总了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;
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:21,代码来源:AggregationPopulationPlotter.java

示例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);
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:22,代码来源:PopulationPlotter.java

示例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;
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:21,代码来源:PopulationPlotter.java

示例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;
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:24,代码来源:SVDModelCumulativePlotRenderer.java

示例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;
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:21,代码来源:EigenvectorModelVariancePlotRenderer.java

示例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;
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:24,代码来源:ClusterModelCentroidPlotRenderer.java

示例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);
}
 
开发者ID:rapidminer,项目名称:rapidminer-studio,代码行数:26,代码来源:LiftDataGenerator.java

示例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;
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:20,代码来源:AggregationPopulationPlotter.java

示例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);
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:20,代码来源:PopulationPlotter.java

示例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;
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:23,代码来源:ROCDataGenerator.java

示例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;
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:20,代码来源:PopulationPlotter.java

示例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);
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:27,代码来源:LiftDataGenerator.java

示例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;
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:22,代码来源:SVDModelCumulativePlotRenderer.java

示例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;
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:18,代码来源:EigenvectorModelVariancePlotRenderer.java

示例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;
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:23,代码来源:ClusterModelCentroidPlotRenderer.java


注:本文中的com.rapidminer.datatable.SimpleDataTableRow类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。