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


Java DataTable.getNumberOfRows方法代码示例

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


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

示例1: getPlotter

import com.rapidminer.datatable.DataTable; //导入方法依赖的package包/类
@Override
public JComponent getPlotter() {
	DataTable table = getDataTable();
	if (table != null && table.getNumberOfRows() > MAX_NUMBER_OF_ROWS) {
		LogService.getRoot().log(Level.INFO, "com.rapidminer.gui.plotter.mathplot.SurfacePlot2D.too_many_examples",
				new Object[] { table.getNumberOfRows(), MAX_NUMBER_OF_ROWS });
		// Display Label with error message because Plot3DPanel can not handle such a lot of
		// data points
		JLabel label = new JLabel(I18N.getGUILabel("surface3DPlot.too_many_examples", MAX_NUMBER_OF_ROWS));
		label.setHorizontalAlignment(SwingConstants.CENTER);
		Font originalFont = label.getFont();
		label.setFont(originalFont.deriveFont((float) (originalFont.getSize() * 1.25)));
		originalFont.deriveFont(new AffineTransform());

		return label;
	} else {
		return super.getPlotter();
	}
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:20,代码来源:SurfacePlot3D.java

示例2: 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

示例3: acceptDataTable

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

示例4: dataTableUpdated

import com.rapidminer.datatable.DataTable; //导入方法依赖的package包/类
/**
 * Invokes {@link #repaint()}. Will be invoked since all plotters are
 * {@link com.rapidminer.datatable.DataTableListener}s.
 */
public final void dataTableUpdated(DataTable source) {
	int maxRowNumber = PlotterPanel.DEFAULT_MAX_NUMBER_OF_DATA_POINTS;
	String maxRowNumberString = ParameterService
			.getParameterValue(MainFrame.PROPERTY_RAPIDMINER_GUI_PLOTTER_ROWS_MAXIMUM);
	if (maxRowNumberString != null && maxRowNumberString.trim().length() > 0) {
		try {
			int newMaxRows = Integer.parseInt(maxRowNumberString);
			maxRowNumber = newMaxRows;
		} catch (NumberFormatException e) {
			// LogService.getGlobal().logWarning("Plotter: cannot read maximum number of plotter points (was '"
			// + maxRowNumberString + "').");
			LogService.getRoot().log(Level.WARNING,
					"com.rapidminer.gui.plotter.PlotterAdapter.reading_maximum_number_of_plotter_points_error",
					maxRowNumberString);
		}
	}

	if (source.getNumberOfRows() > maxRowNumber) {
		DataTable sampledDataTable = source.sample(maxRowNumber);
		// LogService.getGlobal().logWarning("Cannot plot all data points, using only a sample of "
		// + maxRowNumber + " rows.");
		LogService.getRoot().log(Level.WARNING,
				"com.rapidminer.gui.plotter.PlotterAdapter.ploting_all_data_points_error", maxRowNumber);
		setDataTable(sampledDataTable);
	} else {
		setDataTable(source);
	}

	repaint();
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:35,代码来源:PlotterAdapter.java

示例5: 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

示例6: getRejectionReason

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

示例7: DataTableColumnEditTableModel

import com.rapidminer.datatable.DataTable; //导入方法依赖的package包/类
public DataTableColumnEditTableModel(DataTable dataTable, List<String> editableColumnNames) {
	super(dataTable);
	this.dataTable = dataTable;
	this.editableColumnNames = editableColumnNames;
	editableColumnValues = new Object[editableColumnNames.size()][dataTable.getNumberOfRows()];
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:7,代码来源:DataTableColumnEditTableModel.java


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