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


Java ExamplePlotterPoint类代码示例

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


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

示例1: setMousePosInDataSpace

import com.rapidminer.gui.plotter.ExamplePlotterPoint; //导入依赖的package包/类
/** Sets the mouse position in the shown data space. */
@Override
public void setMousePosInDataSpace(int x, int y) {
	if (show) {
		ExamplePlotterPoint point = getPlotterPointForPos(x, y);
		if (point != null) {
			String id = dataTable.getRow(point.getDataTableIndex()).getId();
			if (id != null) {
				setToolTip(id, point.getCurrentPertubatedX(), point.getCurrentPertubatedY());
			} else {
				setToolTip(null, 0.0d, 0.0d);
			}
		} else {
			setToolTip(null, 0.0d, 0.0d);
		}
	}
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:18,代码来源:SOMPlotter.java

示例2: getIdForPos

import com.rapidminer.gui.plotter.ExamplePlotterPoint; //导入依赖的package包/类
@Override
public String getIdForPos(int x, int y) {
	if (this.show) {
		ExamplePlotterPoint point = getPlotterPointForPos(x, y);
		if (point != null) {
			return dataTable.getRow(point.getDataTableIndex()).getId();
		}
	}
	return null;
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:11,代码来源:SOMPlotter.java

示例3: getPlotterPointForPos

import com.rapidminer.gui.plotter.ExamplePlotterPoint; //导入依赖的package包/类
private ExamplePlotterPoint getPlotterPointForPos(int x, int y) {
	Iterator<ExamplePlotterPoint> exampleIterator = exampleCoordinates.iterator();
	while (exampleIterator.hasNext()) {
		ExamplePlotterPoint point = exampleIterator.next();
		if (point.contains(x, y)) {
			return point;
		}
	}
	return null;
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:11,代码来源:SOMPlotter.java

示例4: getIdForPos

import com.rapidminer.gui.plotter.ExamplePlotterPoint; //导入依赖的package包/类
@Override
public String getIdForPos(int x, int y) {
	if (this.show) {
		ExamplePlotterPoint point = getPlotterPointForPos(x,y);
		if (point != null) {
			return dataTable.getRow(point.getDataTableIndex()).getId();
		}
	}
	return(null);	
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:11,代码来源:SOMPlotter.java

示例5: getPlotterPointForPos

import com.rapidminer.gui.plotter.ExamplePlotterPoint; //导入依赖的package包/类
private ExamplePlotterPoint getPlotterPointForPos(int x, int y) {
	Iterator<ExamplePlotterPoint> exampleIterator = exampleCoordinates.iterator();
	while (exampleIterator.hasNext()) {
		ExamplePlotterPoint point = exampleIterator.next();
		if (point.contains(x,y)) {
			return point;
		}
	}
	return null;
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:11,代码来源:SOMPlotter.java

示例6: drawPoints

import com.rapidminer.gui.plotter.ExamplePlotterPoint; //导入依赖的package包/类
protected void drawPoints(Graphics2D g) {
	int pixWidth = getWidth() - 2 * MARGIN;
	int pixHeight = getHeight() - 2 * MARGIN;
	// painting data points
	if (colorColumn >= 0) {
		Iterator<DataTableRow> iterator = dataTable.iterator();
		// Finding Scalevalue for Color Column
		double minColorValue = Double.POSITIVE_INFINITY;
		double maxColorValue = Double.NEGATIVE_INFINITY;

		while (iterator.hasNext()) {
			double value = iterator.next().getValue(colorColumn);
			minColorValue = MathFunctions.robustMin(minColorValue, value);
			maxColorValue = MathFunctions.robustMax(maxColorValue, value);
		}

		// remember point positions
		if (!examplesApplied) {
			int[][] exampleCount = new int[dimensions[0]][dimensions[1]];
			exampleCoordinates.clear();
			iterator = dataTable.iterator();
			int index = 0;
			while (iterator.hasNext()) {
				DataTableRow row = iterator.next();
				// deleting special attributes of a row (ID, Class)
				double[] example = getDoubleArrayFromRow(row, dataTable);
				int[] coords = net.apply(example);
				exampleCoordinates.add(new ExamplePlotterPoint(index, coords[0], coords[1]));
				exampleCount[coords[0]][coords[1]]++;
				index++;
			}
			examplesApplied = true;
			// painting if already applied
		}

		// draw points
		double fieldWidth = pixWidth / (double) dimensions[0];
		double fieldHeight = pixHeight / (double) dimensions[1];
		Iterator<ExamplePlotterPoint> exampleIterator = exampleCoordinates.iterator();
		RandomGenerator random = RandomGenerator.getRandomGenerator(true, 2001);
		ColorProvider colorProvider = getColorProvider();
		while (exampleIterator.hasNext()) {
			ExamplePlotterPoint point = exampleIterator.next();
			double color = 1.0d;
			Color borderColor = Color.BLACK;
			if (coloredPoints) {
				color = colorProvider.getPointColorValue(this.dataTable, dataTable.getRow(point.getDataTableIndex()),
						colorColumn, minColorValue, maxColorValue);
				borderColor = colorProvider.getPointBorderColor(this.dataTable,
						dataTable.getRow(point.getDataTableIndex()), colorColumn);
			}
			double pertX = 0.0d;
			double pertY = 0.0d;
			if (jitterAmount > 0) {
				pertX = random.nextDoubleInRange(-fieldWidth / 2.0d, fieldWidth / 2.0d) * (jitterAmount / 50.0d);
				pertY = random.nextDoubleInRange(-fieldHeight / 2.0d, fieldHeight / 2.0d) * (jitterAmount / 50.0d);
			}
			point.setCurrentPertubatedX((int) (MARGIN + pertX + point.getX() * fieldWidth + fieldWidth / 2.0d));
			point.setCurrentPertubatedY((int) (MARGIN + pertY + point.getY() * fieldHeight + fieldHeight / 2.0d));

			drawPoint(g, point.getCurrentPertubatedX(), point.getCurrentPertubatedY(),
					colorProvider.getPointColor(color), borderColor);
		}
	}
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:66,代码来源:SOMPlotter.java

示例7: drawPoints

import com.rapidminer.gui.plotter.ExamplePlotterPoint; //导入依赖的package包/类
protected void drawPoints(Graphics2D g) {
	int pixWidth  = getWidth() - 2 * MARGIN;
	int pixHeight = getHeight() - 2 * MARGIN;
	//		 painting data points
	if (colorColumn >= 0) {
		Iterator iterator = dataTable.iterator();
		// Finding Scalevalue for Color Column
		double minColorValue = Double.POSITIVE_INFINITY;
		double maxColorValue = Double.NEGATIVE_INFINITY;

		while (iterator.hasNext()) {
			double value = ((DataTableRow) iterator.next()).getValue(colorColumn);
			minColorValue = MathFunctions.robustMin(minColorValue, value);
			maxColorValue = MathFunctions.robustMax(maxColorValue, value);
		}

		// remember point positions
		if (!examplesApplied) {
			int[][] exampleCount = new int[dimensions[0]][dimensions[1]];
			exampleCoordinates.clear();
			iterator = dataTable.iterator();
			int index = 0;
			while (iterator.hasNext()) {
				DataTableRow row = (DataTableRow) iterator.next();
				// deleting special attributes of a row (ID, Class)
				double[] example = getDoubleArrayFromRow(row, dataTable);
				int[] coords = net.apply(example);
				exampleCoordinates.add(new ExamplePlotterPoint(index, coords[0], coords[1]));
				exampleCount[coords[0]][coords[1]]++;
				index++;
			}
			examplesApplied = true;
			// painting if already applied
		}

		// draw points
		double fieldWidth = pixWidth / (double)dimensions[0];
		double fieldHeight = pixHeight / (double)dimensions[1];
		Iterator<ExamplePlotterPoint> exampleIterator = exampleCoordinates.iterator();
		RandomGenerator random = RandomGenerator.getRandomGenerator(true, 2001);
		ColorProvider colorProvider = getColorProvider();
		while (exampleIterator.hasNext()) {
			ExamplePlotterPoint point = exampleIterator.next();
			double color = 1.0d;
			Color borderColor = Color.BLACK;
			if (coloredPoints) {
				color = colorProvider.getPointColorValue(this.dataTable, dataTable.getRow(point.getDataTableIndex()), colorColumn, minColorValue, maxColorValue);
				borderColor = colorProvider.getPointBorderColor(this.dataTable, dataTable.getRow(point.getDataTableIndex()), colorColumn);
			}
			double pertX = 0.0d;
			double pertY = 0.0d;
			if (jitterAmount > 0) {
				pertX = random.nextDoubleInRange(-fieldWidth / 2.0d, fieldWidth / 2.0d) * (jitterAmount / 50.0d);
				pertY = random.nextDoubleInRange(-fieldHeight / 2.0d, fieldHeight / 2.0d) * (jitterAmount / 50.0d);
			}
			point.setCurrentPertubatedX((int)(MARGIN + pertX + point.getX() * fieldWidth + fieldWidth / 2.0d));
			point.setCurrentPertubatedY((int)(MARGIN + pertY + point.getY() * fieldHeight  + fieldHeight / 2.0d));

			drawPoint(g, point.getCurrentPertubatedX(), point.getCurrentPertubatedY(), colorProvider.getPointColor(color), borderColor);
		}
	}
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:63,代码来源:SOMPlotter.java


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