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