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


Java Plotter类代码示例

本文整理汇总了Java中com.rapidminer.gui.plotter.Plotter的典型用法代码示例。如果您正苦于以下问题:Java Plotter类的具体用法?Java Plotter怎么用?Java Plotter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Plotter类属于com.rapidminer.gui.plotter包,在下文中一共展示了Plotter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getPlotter

import com.rapidminer.gui.plotter.Plotter; //导入依赖的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

示例2: getPlotter

import com.rapidminer.gui.plotter.Plotter; //导入依赖的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

示例3: createLiftChartPlotter

import com.rapidminer.gui.plotter.Plotter; //导入依赖的package包/类
private Plotter createLiftChartPlotter(Object renderable) {
	LiftParetoChart paretoChartInformation = (LiftParetoChart) renderable;
	PlotterConfigurationModel settings = new PlotterConfigurationModel(PlotterConfigurationModel.PARETO_PLOT,
			paretoChartInformation.getLiftChartData());
	Plotter plotter = settings.getPlotter();
	settings.setParameterAsString(
			PlotterAdapter.PARAMETER_SUFFIX_AXIS + PlotterAdapter.transformParameterName(plotter.getAxisName(0)),
			settings.getDataTable().getColumnName(0));
	settings.setParameterAsString(PlotterAdapter.PARAMETER_PLOT_COLUMN, settings.getDataTable().getColumnName(1));
	settings.setParameterAsString(ParetoChartPlotter.PARAMETER_COUNT_VALUE, paretoChartInformation.getTargetValue());
	settings.setParameterAsInt(ParetoChartPlotter.PARAMETER_SORTING_DIRECTION, ParetoChartPlotter.KEYS_DESCENDING);
	settings.setParameterAsBoolean(ParetoChartPlotter.PARAMETER_SHOW_BAR_LABELS, paretoChartInformation.showBarLabels());
	settings.setParameterAsBoolean(ParetoChartPlotter.PARAMETER_SHOW_CUMULATIVE_LABELS,
			paretoChartInformation.showCumulativeLabels());
	settings.setParameterAsBoolean(ParetoChartPlotter.PARAMETER_ROTATE_LABELS, paretoChartInformation.rotateLabels());
	return plotter;
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:18,代码来源:LiftChartRenderer.java

示例4: createCentroidPlotter

import com.rapidminer.gui.plotter.Plotter; //导入依赖的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

示例5: getPlotter

import com.rapidminer.gui.plotter.Plotter; //导入依赖的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

示例6: getPlotter

import com.rapidminer.gui.plotter.Plotter; //导入依赖的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

示例7: createCentroidPlotter

import com.rapidminer.gui.plotter.Plotter; //导入依赖的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

示例8: createHistogramPlotter

import com.rapidminer.gui.plotter.Plotter; //导入依赖的package包/类
private Plotter createHistogramPlotter(SimilarityMeasureObject sim, ExampleSet exampleSet) {
	DistanceMeasure measure = sim.getDistanceMeasure();
	DataTable dataTable = new SimpleDataTable("Histogram", new String[] { "Histogram" });
	double sampleRatio = Math.min(1.0d, 500.0d / exampleSet.size());

	Random random = new Random();
	int i = 0;
	for (Example example : exampleSet) {
		int j = 0;
		for (Example comExample : exampleSet) {
			if (j != i && random.nextDouble() < sampleRatio) {
				double simValue;
				if (measure.isDistance()) {
					simValue = measure.calculateDistance(example, comExample);
				} else {
					simValue = measure.calculateSimilarity(example, comExample);
				}
				dataTable.add(new SimpleDataTableRow(new double[] { simValue }));
			}
			j++;
		}
		i++;
	}
	PlotterConfigurationModel settings = new PlotterConfigurationModel(PlotterConfigurationModel.HISTOGRAM_PLOT,
			dataTable);

	settings.enablePlotColumn(0);
	settings.setParameterAsInt(HistogramChart.PARAMETER_NUMBER_OF_BINS, 100);

	return settings.getPlotter();
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:32,代码来源:SimilarityHistogramRenderer.java

示例9: createReportable

import com.rapidminer.gui.plotter.Plotter; //导入依赖的package包/类
@Override
public Reportable createReportable(Object renderable, IOContainer ioContainer, int width, int height) {

	SimilarityMeasureObject sim = (SimilarityMeasureObject) renderable;
	Plotter plotter = createHistogramPlotter(sim, sim.getExampleSet());
	plotter.getRenderComponent().setSize(width, height);
	return plotter;

}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:10,代码来源:SimilarityHistogramRenderer.java

示例10: getVisualizationComponent

import com.rapidminer.gui.plotter.Plotter; //导入依赖的package包/类
@Override
public Component getVisualizationComponent(Object renderable, IOContainer ioContainer) {

	SimilarityMeasureObject sim = (SimilarityMeasureObject) renderable;
	Plotter plotter = createHistogramPlotter(sim, sim.getExampleSet());
	JPanel panel = new JPanel(new BorderLayout());
	JPanel innerPanel = new JPanel(new BorderLayout());
	innerPanel.add(plotter.getPlotter());
	innerPanel.setBorder(BorderFactory.createMatteBorder(10, 10, 5, 5, Colors.WHITE));
	panel.add(innerPanel, BorderLayout.CENTER);
	return panel;

}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:14,代码来源:SimilarityHistogramRenderer.java

示例11: createReportable

import com.rapidminer.gui.plotter.Plotter; //导入依赖的package包/类
@Override
public Reportable createReportable(Object renderable, IOContainer ioContainer, int width, int height) {
	SimilarityMeasureObject sim = (SimilarityMeasureObject) renderable;
	Plotter plotter = createKDistancePlotter(sim, sim.getExampleSet());
	plotter.getRenderComponent().setSize(width, height);
	return plotter;
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:8,代码来源:SimilarityKDistanceRenderer.java

示例12: createReportable

import com.rapidminer.gui.plotter.Plotter; //导入依赖的package包/类
@Override
public Reportable createReportable(Object renderable, IOContainer ioContainer, int width, int height) {
	DistributionModel distributionModel = (DistributionModel) renderable;

	String attributeName = "";
	String range = null;
	try {
		attributeName = getParameterAsString(PARAMETER_ATTRIBUTE_NAME);
		range = getParameterAsString(PARAMETER_RANGE);
	} catch (UndefinedParameterError e) {
		// do nothing
	}

	boolean rotateLabels = getParameterAsBoolean(PARAMETER_ROTATE_LABELS);

	DataTable table = new SimpleDataTable("Dummy", distributionModel.getAttributeNames());
	PlotterConfigurationModel settings = new PlotterConfigurationModel(
			PlotterConfigurationModel.COMPLETE_PLOTTER_SELECTION, table);
	Plotter plotter = new DistributionPlotter(settings, distributionModel);
	settings.setPlotter(plotter);
	settings.setParameterAsString(PlotterAdapter.PARAMETER_PLOT_COLUMN, attributeName);
	settings.setParameterAsBoolean(LabelRotatingPlotterAdapter.PARAMETER_ROTATE_LABELS, rotateLabels);

	if (range != null) {
		String rangeList = ParameterTypeList.transformList2String(Collections.singletonList(new String[] {
				DistributionPlotter.MODEL_DOMAIN_AXIS_NAME, range }));
		settings.setParameterAsString(RangeablePlotterAdapter.PARAMETER_PREFIX_RANGE_LIST, rangeList);
	}

	plotter.getRenderComponent().setSize(width, height);
	return plotter;
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:33,代码来源:DistributionModelPlotRenderer.java

示例13: getVisualizationComponent

import com.rapidminer.gui.plotter.Plotter; //导入依赖的package包/类
@Override
public Component getVisualizationComponent(Object renderable, IOContainer ioContainer) {
	SOMModelVisualizationResult result = (SOMModelVisualizationResult) renderable;
	DataTable table = new DataTableExampleSetAdapter(result.getExampleSet(), null);
	PlotterConfigurationModel settings = new PlotterConfigurationModel(
			PlotterConfigurationModel.MODEL_PLOTTER_SELECTION, table);
	settings.setPlotter("SOM");
	PlotterPanel panel = new PlotterPanel(settings);
	Plotter plotter = settings.getPlotter();
	((SOMModelPlotter) plotter).setExampleSet(result.getExampleSet());
	((SOMModelPlotter) plotter).setModel(result.getModel());
	return panel;
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:14,代码来源:SOMModelVisualizationRenderer.java

示例14: getPlotterSettingsFromHistory

import com.rapidminer.gui.plotter.Plotter; //导入依赖的package包/类
public static PlotterConfigurationModel getPlotterSettingsFromHistory(IOObject object, DataTable dataTable, LinkedHashMap<String, Class<? extends Plotter>> plotterSelections) {
	List<ProcessingStep> steps = object.getProcessingHistory();
	ListIterator<ProcessingStep> iterator = steps.listIterator(steps.size());
	PlotterConfigurationModel configurationModel = null;
	boolean isFirst = true;
	while (iterator.hasPrevious()) {
		ProcessingStep step = iterator.previous();
		PlotterConfigurationSettings settings = settingsHistory.get(step);
		if (settings != null) {
			// if it's not the last operator in history: Clone and register for last process step
			if (!isFirst) {
				settings = settings.clone();
				settingsHistory.put(steps.get(steps.size() - 1), settings);
			}
			configurationModel = new PlotterConfigurationModel(settings, plotterSelections, dataTable);
			// then break: Use the last found known step
			break;
		}
		isFirst = false;
	}
	// if we didn't find anything: Create new settings and add to history
	if (configurationModel == null) {
		configurationModel = new PlotterConfigurationModel(plotterSelections, dataTable);
		if (!steps.isEmpty())
			settingsHistory.put(steps.get(steps.size() - 1), configurationModel.getPlotterSettings());
	}
	return configurationModel;
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:29,代码来源:PlotterSettingsHistory.java

示例15: createHistogramPlotter

import com.rapidminer.gui.plotter.Plotter; //导入依赖的package包/类
private Plotter createHistogramPlotter(SimilarityMeasureObject sim, ExampleSet exampleSet) {
	DistanceMeasure measure = sim.getDistanceMeasure();
	DataTable dataTable = new SimpleDataTable("Histogram", new String[] { "Histogram" });
	double sampleRatio = Math.min(1.0d, 500.0d / exampleSet.size());

	Random random = new Random();
	int i = 0;
	for (Example example : exampleSet) {
		int j = 0;
		for (Example comExample : exampleSet) {
			if (j != i && random.nextDouble() < sampleRatio) {
				double simValue;
				if (measure.isDistance())
					simValue = measure.calculateDistance(example, comExample);
				else
					simValue = measure.calculateSimilarity(example, comExample);
				dataTable.add(new SimpleDataTableRow(new double[] { simValue }));
			}
			j++;
		}
		i++;
	}
	PlotterConfigurationModel settings = new PlotterConfigurationModel(PlotterConfigurationModel.HISTOGRAM_PLOT, dataTable);
	
	settings.enablePlotColumn(0);
	settings.setParameterAsInt(HistogramChart.PARAMETER_NUMBER_OF_BINS, 100);

	return settings.getPlotter();
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:30,代码来源:SimilarityHistogramRenderer.java


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