本文整理汇总了Java中com.rapidminer.datatable.DataTable.isSupportingColumnWeights方法的典型用法代码示例。如果您正苦于以下问题:Java DataTable.isSupportingColumnWeights方法的具体用法?Java DataTable.isSupportingColumnWeights怎么用?Java DataTable.isSupportingColumnWeights使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.rapidminer.datatable.DataTable
的用法示例。
在下文中一共展示了DataTable.isSupportingColumnWeights方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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;
}
示例2: drawWeightRectangle
import com.rapidminer.datatable.DataTable; //导入方法依赖的package包/类
protected void drawWeightRectangle(Graphics2D newSpace, DataTable dataTable, int column, double maxWeight,
int plotterSize) {
if (dataTable.isSupportingColumnWeights()) {
newSpace.setColor(getWeightColor(dataTable.getColumnWeight(column), maxWeight));
Rectangle2D weightRect = new Rectangle2D.Double(1, 1, plotterSize - 2, plotterSize - 2);
newSpace.fill(weightRect);
newSpace.setColor(Color.WHITE);
int weightBorder = WEIGHT_BORDER_WIDTH + 1;
weightRect = new Rectangle2D.Double(weightBorder, weightBorder, plotterSize - 2 * weightBorder, plotterSize - 2
* weightBorder);
newSpace.fill(weightRect);
}
}