本文整理汇总了Java中tech.tablesaw.api.Table.categoryColumn方法的典型用法代码示例。如果您正苦于以下问题:Java Table.categoryColumn方法的具体用法?Java Table.categoryColumn怎么用?Java Table.categoryColumn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tech.tablesaw.api.Table
的用法示例。
在下文中一共展示了Table.categoryColumn方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: asTableComplete
import tech.tablesaw.api.Table; //导入方法依赖的package包/类
public Table asTableComplete() {
Table t = asTable();
CategoryColumn measure = t.categoryColumn("Measure");
FloatColumn value = t.floatColumn("Value");
measure.add("Sum of Squares");
value.append(sumOfSquares());
measure.add("Sum of Logs");
value.append(sumOfLogs());
measure.add("Population Variance");
value.append(populationVariance());
measure.add("Geometric Mean");
value.append(geometricMean());
measure.add("Quadratic Mean");
value.append(quadraticMean());
measure.add("Second Moment");
value.append(secondMoment());
return t;
}
示例2: chart
import tech.tablesaw.api.Table; //导入方法依赖的package包/类
public static BarChart<String, Number> chart(String title, Table table, String categoryColumnName, String
numericColumnName) {
CategoryColumn categoryColumn = table.categoryColumn(categoryColumnName);
NumericColumn numericColumn = table.nCol(numericColumnName);
return chart(title, categoryColumn, numericColumn);
}
示例3: chart
import tech.tablesaw.api.Table; //导入方法依赖的package包/类
public static BarChart<Number, String> chart(
String title,
Table table,
String categoryColumnName,
String numericColumnName) {
CategoryColumn categoryColumn = table.categoryColumn(categoryColumnName);
NumericColumn numericColumn = table.nCol(numericColumnName);
return chart(title, categoryColumn, numericColumn);
}
示例4: testCountByGroup
import tech.tablesaw.api.Table; //导入方法依赖的package包/类
@Test
public void testCountByGroup() {
Table groups = table.count("approval").by("who");
assertEquals(2, groups.columnCount());
assertEquals(6, groups.rowCount());
CategoryColumn group = groups.categoryColumn(0);
assertTrue(group.contains("fox"));
}
示例5: 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'));
out(table.structure());
out(table.shape());
ShortColumn movie = table.shortColumn("movie");
CategoryColumn moviecat = new CategoryColumn("MovieCat");
for (int i = 0; i < movie.size(); i++) {
moviecat.appendCell(movie.getString(i));
}
table.addColumn(moviecat);
out(table.shortColumn("user").unique().size());
out(table.shortColumn("movie").unique().size());
FrequentItemset model = new FrequentItemset(table.shortColumn("user"), table.categoryColumn("MovieCat"), .24);
List<ItemSet> itemSetList = model.learn();
out("Frequent Itemsets");
for (ItemSet itemSet : itemSetList) {
if (itemSet.items.length == 2)
out(itemSet);
}
out(model.supportMap(250));
Object2DoubleOpenHashMap<IntRBTreeSet> confidenceMap = model.confidenceMap(.90);
Object2DoubleMap.FastEntrySet<IntRBTreeSet> entrySet = confidenceMap.object2DoubleEntrySet();
out("");
out("Confidence Map");
for (Object2DoubleMap.Entry<IntRBTreeSet> entry : entrySet) {
out(entry.getKey() + " : " + entry.getDoubleValue());
}
Object2DoubleOpenHashMap<IntRBTreeSet> confidenceMap2 = model.confidenceMap();
Object2DoubleMap.FastEntrySet<IntRBTreeSet> entrySet2 = confidenceMap2.object2DoubleEntrySet();
out("");
out("Confidence Map2");
for (Object2DoubleMap.Entry<IntRBTreeSet> entry2 : entrySet2) {
out(entry2.getKey() + " : " + entry2.getDoubleValue());
}
}
示例6: testCustomFunction
import tech.tablesaw.api.Table; //导入方法依赖的package包/类
@Test
public void testCustomFunction() {
Table exaggeration = table.summarize("approval", exaggerate).by("who");
CategoryColumn group = exaggeration.categoryColumn(0);
assertTrue(group.contains("fox"));
}
示例7: chart
import tech.tablesaw.api.Table; //导入方法依赖的package包/类
public static PieChart chart(String title, Table table, String categoryColumnName, String numericColumnName) {
CategoryColumn categoryColumn = table.categoryColumn(categoryColumnName);
NumericColumn numericColumn = table.nCol(numericColumnName);
return chart(title, categoryColumn, numericColumn);
}