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


Java DataTable.getNumberOfColumns方法代码示例

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


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

示例1: setDataTable

import com.rapidminer.datatable.DataTable; //导入方法依赖的package包/类
@Override
public void setDataTable(DataTable dataTable) {
	super.setDataTable(dataTable);
	this.dataTable = dataTable;
	this.plotColumns = new boolean[dataTable.getNumberOfColumns()];
	this.showLines = new boolean[dataTable.getNumberOfColumns()];
	this.showPoints = new boolean[dataTable.getNumberOfColumns()];
	for (int i = 0; i < showLines.length; i++) {
		showLines[i] = false;
		showPoints[i] = true;
	}
	updatePlotter();
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:14,代码来源:MultipleScatterPlotter.java

示例2: acceptDataTable

import com.rapidminer.datatable.DataTable; //导入方法依赖的package包/类
@Override
public boolean acceptDataTable(DataTable dataTable) {
	int numberOfColumns = dataTable.getNumberOfColumns();
	if ((numberOfColumns >= minColumns) && (numberOfColumns <= maxColumns)) {
		return true;
	} else {
		return false;
	}
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:10,代码来源:ColumnsPlotterCondition.java

示例3: getDoubleArrayFromRow

import com.rapidminer.datatable.DataTable; //导入方法依赖的package包/类
private double[] getDoubleArrayFromRow(DataTableRow row, DataTable table) {
	double[] doubleRow = new double[table.getNumberOfColumns() - table.getNumberOfSpecialColumns()];
	int index = 0;
	for (int i = 0; i < row.getNumberOfValues(); i++) {
		if (!table.isSpecial(i)) {
			doubleRow[index] = row.getValue(i);
			index++;
		}
	}
	return doubleRow;
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:12,代码来源:SOMPlotter.java

示例4: drawLegend

import com.rapidminer.datatable.DataTable; //导入方法依赖的package包/类
/** This method can be used to draw a legend on the given graphics context. */
protected void drawLegend(Graphics graphics, DataTable table, int legendColumn, int xOffset, int alpha) {
	if (legendColumn < 0 || legendColumn > table.getNumberOfColumns() - 1) {
		return;
	}
	if (table.isNominal(legendColumn)) {
		String maxNominalValuesString = ParameterService
				.getParameterValue(MainFrame.PROPERTY_RAPIDMINER_GUI_PLOTTER_LEGEND_CLASSLIMIT);
		int maxNumberOfNominalValues = 10;
		try {
			if (maxNominalValuesString != null) {
				maxNumberOfNominalValues = Integer.parseInt(maxNominalValuesString);
			}
		} catch (NumberFormatException e) {
			// LogService.getGlobal().logWarning("Plotter: cannot parse maximal number of nominal values for legend ("
			// + maxNominalValuesString +
			// ")! Using 10...");
			LogService.getRoot().log(Level.WARNING,
					"com.rapidminer.gui.plotter.PlotterAdapter.parsing_maximal_number_of_nominal_values_error",
					maxNominalValuesString);
		}
		if (maxNumberOfNominalValues == -1 || table.getNumberOfValues(legendColumn) <= maxNumberOfNominalValues) {
			drawNominalLegend(graphics, table, legendColumn, xOffset, alpha);
		} else {
			// LogService.getGlobal().logWarning("Plotter: cannot draw nominal legend since number of different values is too high (more than "
			// +
			// maxNominalValuesString + ")! Using numerical legend instead.");
			LogService.getRoot().log(Level.WARNING,
					"com.rapidminer.gui.plotter.PlotterAdapter.drawing_nominal_legend_error", maxNominalValuesString);
			drawNumericalLegend(graphics, table, legendColumn, alpha);
		}
	} else if (table.isDate(legendColumn) || table.isTime(legendColumn) || table.isDateTime(legendColumn)) {
		drawDateLegend(graphics, table, legendColumn, alpha);
	} else {
		drawNumericalLegend(graphics, table, legendColumn, alpha);
	}
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:38,代码来源:PlotterAdapter.java

示例5: getNumberOfPlots

import com.rapidminer.datatable.DataTable; //导入方法依赖的package包/类
protected int getNumberOfPlots(DataTable table) {
	int counter = 0;
	for (int i = 0; i < table.getNumberOfColumns(); i++) {
		if (getPlotColumn(i)) {
			counter++;
		}
	}
	return counter;
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:10,代码来源:PlotterAdapter.java

示例6: getMaxWeight

import com.rapidminer.datatable.DataTable; //导入方法依赖的package包/类
protected double getMaxWeight(DataTable dataTable) {
	double maxWeight = Double.NaN;
	if (dataTable.isSupportingColumnWeights()) {
		maxWeight = Double.NEGATIVE_INFINITY;
		for (int c = 0; c < dataTable.getNumberOfColumns(); c++) {
			double weight = dataTable.getColumnWeight(c);
			if (!Double.isNaN(weight)) {
				maxWeight = Math.max(Math.abs(weight), maxWeight);
			}
		}
	}
	return maxWeight;
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:14,代码来源:PlotterAdapter.java

示例7: assembleDataTableColumnList

import com.rapidminer.datatable.DataTable; //导入方法依赖的package包/类
/**
 * Inspects the {@link DataTable} and assembles a model for the attribute selection list.
 */
private Vector<DataTableColumn> assembleDataTableColumnList(DataTable dataTable) {
	Vector<DataTableColumn> dataTableColumnVector = new Vector<DataTableColumn>();
	int numberOfColumns = dataTable.getNumberOfColumns();
	for (int i = 0; i < numberOfColumns; ++i) {
		dataTableColumnVector.add(new DataTableColumn(dataTable, i));
	}
	return dataTableColumnVector;
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:12,代码来源:ChartConfigurationPanel.java

示例8: doWork

import com.rapidminer.datatable.DataTable; //导入方法依赖的package包/类
@Override
public void doWork() throws OperatorException {
	DataTable table = null;
	if (isParameterSet(PARAMETER_LOG_NAME)) {
		String dataTableName = getParameterAsString(PARAMETER_LOG_NAME);
		table = getProcess().getDataTable(dataTableName);
	} else {
		if (getProcess().getDataTables().size() > 0) {
			table = getProcess().getDataTables().iterator().next();
			logNote("No log name was specified, using first data table found...");
		}
	}

	// check
	if (table == null) {
		throw new UserError(this, 939);
	}

	// create attributes
	List<Attribute> attributes = new ArrayList<Attribute>();
	for (int i = 0; i < table.getNumberOfColumns(); i++) {
		String name = table.getColumnName(i);
		if (table.isDate(i)) {
			attributes.add(AttributeFactory.createAttribute(name, Ontology.DATE));
		} else if (table.isDateTime(i)) {
			attributes.add(AttributeFactory.createAttribute(name, Ontology.DATE_TIME));
		} else if (table.isNumerical(i)) {
			attributes.add(AttributeFactory.createAttribute(name, Ontology.REAL));
		} else {
			attributes.add(AttributeFactory.createAttribute(name, Ontology.NOMINAL));
		}
	}

	// create table
	MemoryExampleTable exampleTable = new MemoryExampleTable(attributes);
	for (int r = 0; r < table.getNumberOfRows(); r++) {
		DataTableRow row = table.getRow(r);
		double[] data = new double[attributes.size()];
		for (int i = 0; i < table.getNumberOfColumns(); i++) {
			if (table.isDate(i)) {
				data[i] = row.getValue(i);
			} else if (table.isDateTime(i)) {
				data[i] = row.getValue(i);
			} else if (table.isNumerical(i)) {
				data[i] = row.getValue(i);
			} else {
				Attribute attribute = attributes.get(i);
				String value = table.getValueAsString(row, i);
				data[i] = attribute.getMapping().mapString(value);
			}
		}
		exampleTable.addDataRow(new DoubleArrayDataRow(data));
	}

	// create and return example set
	exampleSetOutput.deliver(exampleTable.createExampleSet());
	dummyPorts.passDataThrough();
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:59,代码来源:ProcessLog2ExampleSet.java

示例9: setDataTable

import com.rapidminer.datatable.DataTable; //导入方法依赖的package包/类
@Override
public void setDataTable(DataTable dataTable) {
	super.setDataTable(dataTable);
	this.dataTable = dataTable;
	columns = new boolean[dataTable.getNumberOfColumns()];
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:7,代码来源:JMathPlotter.java

示例10: setDataTable

import com.rapidminer.datatable.DataTable; //导入方法依赖的package包/类
@Override
public void setDataTable(DataTable dataTable) {
	this.columns = new boolean[dataTable.getNumberOfColumns()];
	super.setDataTable(dataTable);
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:6,代码来源:QuartilePlotter.java

示例11: getRejectionReason

import com.rapidminer.datatable.DataTable; //导入方法依赖的package包/类
@Override
public String getRejectionReason(DataTable dataTable) {
	return "Data table must have between " + minColumns + " and " + maxColumns + " columns, was "
			+ dataTable.getNumberOfColumns() + ".";
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:6,代码来源:ColumnsPlotterCondition.java

示例12: populateCategoryMap

import com.rapidminer.datatable.DataTable; //导入方法依赖的package包/类
private void populateCategoryMap(DataTable dataTable) {
	this.categoryToColumnListMap.put(HeuristicPlotterConfigurator.NUMERICAL, new ArrayList<String>());
	this.categoryToColumnListMap.put(HeuristicPlotterConfigurator.LABEL, new ArrayList<String>());
	this.categoryToColumnListMap.put(HeuristicPlotterConfigurator.NOMINAL, new ArrayList<String>());
	this.categoryToColumnListMap.put(HeuristicPlotterConfigurator.DATE, new ArrayList<String>());

	for (int i = 0; i < dataTable.getNumberOfColumns(); i++) {
		if (dataTable.isNumerical(i)) {
			this.categoryToColumnListMap.get(HeuristicPlotterConfigurator.NUMERICAL).add(dataTable.getColumnName(i));
		}
		if (dataTable.isNominal(i)) {
			if (dataTable.getNumberOfValues(i) <= MAX_NOMINAL_VALUES) {
				this.categoryToColumnListMap.get(HeuristicPlotterConfigurator.NOMINAL).add(dataTable.getColumnName(i));
			}
		}
		if (dataTable.isDateTime(i)) {
			this.categoryToColumnListMap.get(HeuristicPlotterConfigurator.DATE).add(dataTable.getColumnName(i));
		}
	}

	if (dataTable instanceof DataTableExampleSetAdapter) {
		DataTableExampleSetAdapter mine = (DataTableExampleSetAdapter) dataTable;

		String labelName = mine.getLabelName();
		if (labelName != null) {

			if (mine.isLabelNominal()) {
				// only add nominal labels with less than MAX_NOMINAL_VALUES different values
				if (mine.getNumberOfValues(mine.getColumnIndex(labelName)) <= MAX_NOMINAL_VALUES) {
					this.categoryToColumnListMap.get(HeuristicPlotterConfigurator.NOMINAL).add(labelName);
					this.categoryToColumnListMap.get(HeuristicPlotterConfigurator.LABEL).add(labelName);
				}
			} else {
				this.categoryToColumnListMap.get(HeuristicPlotterConfigurator.LABEL).add(labelName);
			}
			// remove Label from the numerical attribute list
			if (this.categoryToColumnListMap.get(HeuristicPlotterConfigurator.NUMERICAL).contains(labelName)) {
				this.categoryToColumnListMap.get(HeuristicPlotterConfigurator.NUMERICAL).remove(labelName);
			}
		}
		// if there is a cluster attribute it can be handled as an additional label for axis
		// selection:
		if (mine.getClusterName() != null) {
			this.categoryToColumnListMap.get(HeuristicPlotterConfigurator.LABEL).add(mine.getClusterName());
		}

	} else { // set empty values unless Label and Nominal are already set
		if (categoryToColumnListMap.get(HeuristicPlotterConfigurator.LABEL).equals("")) {
			this.categoryToColumnListMap.put(HeuristicPlotterConfigurator.LABEL, new ArrayList<String>());
		}
		if (categoryToColumnListMap.get(HeuristicPlotterConfigurator.NOMINAL).equals("")) {
			this.categoryToColumnListMap.put(HeuristicPlotterConfigurator.NOMINAL, new ArrayList<String>());
		}
	}
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:56,代码来源:HeuristicPlotterConfigurator.java


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