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


Java DataTable.iterator方法代码示例

本文整理汇总了Java中com.rapidminer.datatable.DataTable.iterator方法的典型用法代码示例。如果您正苦于以下问题:Java DataTable.iterator方法的具体用法?Java DataTable.iterator怎么用?Java DataTable.iterator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.rapidminer.datatable.DataTable的用法示例。


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

示例1: calculateQuartile

import com.rapidminer.datatable.DataTable; //导入方法依赖的package包/类
public static Quartile calculateQuartile(DataTable table, int column) {
	double mean = 0.0d;
	double squaredSum = 0.0d;
	List<Double> values = new ArrayList<Double>();
	Iterator<DataTableRow> i = table.iterator();

	while (i.hasNext()) {
		DataTableRow row = i.next();
		double value = row.getValue(column);
		mean += value;
		squaredSum += value * value;
		values.add(value);
	}
	mean /= table.getNumberOfRows();
	squaredSum /= table.getNumberOfRows();
	double standardDeviation = Math.sqrt(squaredSum - (mean * mean));
	return calculateQuartile(mean, standardDeviation, values);
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:19,代码来源:Quartile.java

示例2: update

import com.rapidminer.datatable.DataTable; //导入方法依赖的package包/类
@Override
public void update() {
	if (getAxis(0) != -1 && getAxis(1) != -1) {
		getPlotPanel().removeAllPlots();
		int totalNumberOfColumns = countColumns();
		for (int currentVariable = 0; currentVariable < totalNumberOfColumns; currentVariable++) {
			if (getPlotColumn(currentVariable)) {
				DataTable table = getDataTable();
				synchronized (table) {
					Iterator<DataTableRow> iterator = table.iterator();
					int i = 0;
					double[][] data = new double[getDataTable().getNumberOfRows()][3];
					while (iterator.hasNext()) {
						DataTableRow row = iterator.next();
						data[i][0] = row.getValue(getAxis(0));
						data[i][1] = row.getValue(getAxis(1));
						data[i][2] = row.getValue(currentVariable);
						if (Double.isNaN(data[i][0]) || Double.isNaN(data[i][1]) || Double.isNaN(data[i][2])) {
							data[i][0] = 0.0d;
							data[i][1] = 0.0d;
							data[i][2] = 0.0d;
						}
						i++;
					}
					// PlotPanel construction
					Color color = getColorProvider().getPointColor(
							(double) (currentVariable + 1) / (double) totalNumberOfColumns);
					((Plot3DPanel) getPlotPanel()).addScatterPlot(getDataTable().getColumnName(currentVariable), color,
							data);
				}
			}
		}
	} else {
		getPlotPanel().removeAllPlots();
	}
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:37,代码来源:ScatterPlot3D.java

示例3: update

import com.rapidminer.datatable.DataTable; //导入方法依赖的package包/类
@Override
public void update() {
	if (getAxis(0) != -1 && getAxis(1) != -1) {
		getPlotPanel().removeAllPlots();
		int totalNumberOfColumns = countColumns();
		for (int currentVariable = 0; currentVariable < totalNumberOfColumns; currentVariable++) {
			if (getPlotColumn(currentVariable)) {
				DataTable table = getDataTable();
				synchronized (table) {
					Iterator iterator = table.iterator();
					int i = 0;
					double[][] data = new double[getDataTable().getNumberOfRows()][3];
					while (iterator.hasNext()) {
						DataTableRow row = (DataTableRow) iterator.next();
						data[i][0] = row.getValue(getAxis(0));
						if (Double.isNaN(data[i][0])) {
							data[i][0] = 0.0d;
						}
						data[i][1] = row.getValue(getAxis(1));
						if (Double.isNaN(data[i][1])) {
							data[i][1] = 0.0d;
						}
						data[i][2] = row.getValue(currentVariable);
						if (Double.isNaN(data[i][2])) {
							data[i][2] = 0.0d;
						}
						i++;
					}
					// PlotPanel construction
					Color color = getColorProvider().getPointColor(
							(double) (currentVariable + 1) / (double) totalNumberOfColumns);
					((Plot3DPanel) getPlotPanel())
							.addBarPlot(getDataTable().getColumnName(currentVariable), color, data);
				}
			}
		}
	} else {
		getPlotPanel().removeAllPlots();
	}
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:41,代码来源:SticksPlot3D.java

示例4: update

import com.rapidminer.datatable.DataTable; //导入方法依赖的package包/类
@Override
public void update() {
	if (getAxis(0) != -1) {
		getPlotPanel().removeAllPlots();
		int totalNumberOfColumns = countColumns();
		for (int currentVariable = 0; currentVariable < totalNumberOfColumns; currentVariable++) {
			if (getPlotColumn(currentVariable)) {
				DataTable table = getDataTable();
				synchronized (table) {
					Iterator iterator = table.iterator();
					int i = 0;
					double[][] data = new double[getDataTable().getNumberOfRows()][2];
					while (iterator.hasNext()) {
						DataTableRow row = (DataTableRow) iterator.next();
						data[i][0] = row.getValue(getAxis(0));
						if (Double.isNaN(data[i][0])) {
							data[i][0] = 0.0d;
						}
						data[i][1] = row.getValue(currentVariable);
						if (Double.isNaN(data[i][1])) {
							data[i][1] = 0.0d;
						}
						i++;
					}
					// PlotPanel construction
					Color color = getColorProvider().getPointColor(
							(double) (currentVariable + 1) / (double) totalNumberOfColumns);
					((Plot2DPanel) getPlotPanel())
							.addBarPlot(getDataTable().getColumnName(currentVariable), color, data);
				}
			}
		}
	} else {
		getPlotPanel().removeAllPlots();
	}
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:37,代码来源:SticksPlot2D.java

示例5: drawDateLegend

import com.rapidminer.datatable.DataTable; //导入方法依赖的package包/类
private void drawDateLegend(Graphics graphics, DataTable table, int legendColumn, int alpha) {
	double min = Double.POSITIVE_INFINITY;
	double max = Double.NEGATIVE_INFINITY;
	synchronized (table) {
		Iterator<DataTableRow> i = table.iterator();
		while (i.hasNext()) {
			DataTableRow row = i.next();
			double colorValue = row.getValue(legendColumn);
			min = MathFunctions.robustMin(min, colorValue);
			max = MathFunctions.robustMax(max, colorValue);
		}
	}
	String minColorString = null;
	String maxColorString = null;
	if (table.isDate(legendColumn)) {
		minColorString = Tools.createDateAndFormat(min);
		maxColorString = Tools.createDateAndFormat(max);
	} else if (table.isTime(legendColumn)) {
		minColorString = Tools.createTimeAndFormat(min);
		maxColorString = Tools.createTimeAndFormat(max);
	} else if (table.isDateTime(legendColumn)) {
		minColorString = Tools.createDateTimeAndFormat(min);
		maxColorString = Tools.createDateTimeAndFormat(max);
	} else {
		minColorString = Tools.formatNumber(min);
		maxColorString = Tools.formatNumber(max);
	}

	drawNumericalLegend(graphics, getWidth(), minColorString, maxColorString, table.getColumnName(legendColumn), alpha);
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:31,代码来源:PlotterAdapter.java

示例6: drawNumericalLegend

import com.rapidminer.datatable.DataTable; //导入方法依赖的package包/类
private void drawNumericalLegend(Graphics graphics, DataTable table, int legendColumn, int alpha) {
	double min = Double.POSITIVE_INFINITY;
	double max = Double.NEGATIVE_INFINITY;
	synchronized (table) {
		Iterator<DataTableRow> i = table.iterator();
		while (i.hasNext()) {
			DataTableRow row = i.next();
			double colorValue = row.getValue(legendColumn);
			min = MathFunctions.robustMin(min, colorValue);
			max = MathFunctions.robustMax(max, colorValue);
		}
	}
	drawNumericalLegend(graphics, table.getColumnName(legendColumn), min, max, alpha);
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:15,代码来源:PlotterAdapter.java

示例7: update

import com.rapidminer.datatable.DataTable; //导入方法依赖的package包/类
@Override
public void update() {
	if (getAxis(0) != -1 && getAxis(1) != -1 && getAxis(2) != -1) {
		getPlotPanel().removeAllPlots();
		int totalNumberOfColumns = countColumns();
		for (int currentVariable = 0; currentVariable < totalNumberOfColumns; currentVariable++) {
			if (getPlotColumn(currentVariable)) {
				DataTable table = getDataTable();
				synchronized (table) {
					Iterator iterator = table.iterator();
					int i = 0;
					double[][] data = new double[getDataTable().getNumberOfRows()][3];
					double[][] deviation = new double[getDataTable().getNumberOfRows()][3];
					while (iterator.hasNext()) {
						DataTableRow row = (DataTableRow) iterator.next();
						data[i][0] = row.getValue(getAxis(0));
						if (Double.isNaN(data[i][0])) {
							data[i][0] = 0.0d;
						}
						data[i][1] = row.getValue(getAxis(1));
						if (Double.isNaN(data[i][1])) {
							data[i][1] = 0.0d;
						}
						data[i][2] = row.getValue(currentVariable);
						if (Double.isNaN(data[i][2])) {
							data[i][2] = 0.0d;
						}
						deviation[i][0] = deviation[i][1] = deviation[i][2] = row.getValue(currentVariable);
						if (Double.isNaN(deviation[i][0])) {
							deviation[i][0] = deviation[i][1] = deviation[i][2] = 0.0d;
						}
						i++;
					}
					// PlotPanel construction
					Color color = getColorProvider().getPointColor(
							(double) (currentVariable + 1) / (double) totalNumberOfColumns);
					((Plot3DPanel) getPlotPanel()).addBoxPlot(getDataTable().getColumnName(currentVariable), color,
							data, deviation);
				}
			}
		}
	} else {
		getPlotPanel().removeAllPlots();
	}
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:46,代码来源:BoxPlot3D.java

示例8: update

import com.rapidminer.datatable.DataTable; //导入方法依赖的package包/类
@Override
public void update() {
	if (getAxis(0) != -1 && getAxis(1) != -1) {
		getPlotPanel().removeAllPlots();
		int totalNumberOfColumns = countColumns();
		for (int currentVariable = 0; currentVariable < totalNumberOfColumns; currentVariable++) {
			if (getPlotColumn(currentVariable)) {
				DataTable table = getDataTable();
				synchronized (table) {
					Iterator iterator = table.iterator();
					int i = 0;
					double[][] data = new double[getDataTable().getNumberOfRows()][2];
					double[][] deviation = new double[getDataTable().getNumberOfRows()][2];
					while (iterator.hasNext()) {
						DataTableRow row = (DataTableRow) iterator.next();
						data[i][0] = row.getValue(getAxis(0));
						if (Double.isNaN(data[i][0])) {
							data[i][0] = 0.0d;
						}
						data[i][1] = row.getValue(getAxis(1));
						if (Double.isNaN(data[i][1])) {
							data[i][1] = 0.0d;
						}
						deviation[i][0] = deviation[i][1] = row.getValue(currentVariable);
						if (Double.isNaN(deviation[i][0])) {
							deviation[i][0] = deviation[i][1] = 0.0d;
						}
						i++;
					}
					// PlotPanel construction
					Color color = getColorProvider().getPointColor(
							(double) (currentVariable + 1) / (double) totalNumberOfColumns);
					((Plot2DPanel) getPlotPanel()).addBoxPlot(getDataTable().getColumnName(currentVariable), color,
							data, deviation);
				}
			}
		}
	} else {
		getPlotPanel().removeAllPlots();
	}
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:42,代码来源:BoxPlot2D.java


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