本文整理汇总了Java中tech.tablesaw.api.Table.sortDescendingOn方法的典型用法代码示例。如果您正苦于以下问题:Java Table.sortDescendingOn方法的具体用法?Java Table.sortDescendingOn怎么用?Java Table.sortDescendingOn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tech.tablesaw.api.Table
的用法示例。
在下文中一共展示了Table.sortDescendingOn方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: chart
import tech.tablesaw.api.Table; //导入方法依赖的package包/类
public static BarChart<String, Number> chart(String title, IntColumn categoryColumn, NumericColumn numericColumn) {
Table t = Table.create("", categoryColumn, numericColumn);
t = t.sortDescendingOn(numericColumn.name());
final CategoryAxis categoryAxis = getCategoryAxis(t.categoryColumn(0));
final NumberAxis numberAxis = getNumberAxis(t.numericColumn(1));
final BarChart<String, Number> barChart = getBarChart(title, categoryAxis, numberAxis);
List<XYChart.Data<String, Number>> data = new ArrayList<>(categoryColumn.size());
for (int i = 0; i < categoryColumn.size(); i++) {
data.add(new XYChart.Data<>(categoryColumn.getString(i), numericColumn.getFloat(i)));
}
barChart.getData().add(getSeries(numericColumn, data));
return barChart;
}
示例2: main
import tech.tablesaw.api.Table; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
Table table = Table.read().csv(CsvReadOptions
.builder("../data/movielens.data")
.separator('\t'));
double supportThreshold = .25;
double confidenceThreshold = .5;
double interestThreshold = .5;
AssociationRuleMining model = new AssociationRuleMining(table.shortColumn("user"), table.shortColumn("movie")
, supportThreshold);
FrequentItemset frequentItemsetModel = new FrequentItemset(table.shortColumn("user"), table.shortColumn
("movie"), supportThreshold);
Object2DoubleOpenHashMap<IntRBTreeSet> confidenceMap = frequentItemsetModel.confidenceMap();
Table interestingRuleTable = model.interest(confidenceThreshold, interestThreshold, confidenceMap);
interestingRuleTable = interestingRuleTable.sortDescendingOn("Interest", "Antecedent");
out(interestingRuleTable);
}
示例3: testWithBusData
import tech.tablesaw.api.Table; //导入方法依赖的package包/类
@Test
public void testWithBusData() throws Exception {
// Read the CSV file
Table table = Table.read().csv(CsvReadOptions
.builder("../data/bus_stop_test.csv")
.columnTypes(bus_types));
// Look at the column names
assertEquals("[stop_id, stop_name, stop_desc, stop_lat, stop_lon]", table.columnNames().toString());
table = table.sortDescendingOn("stop_id");
table.removeColumns("stop_desc");
}