本文整理汇总了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);
}
示例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();
}
}
示例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();
}
}
示例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();
}
}
示例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);
}
示例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);
}
示例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();
}
}
示例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();
}
}