本文整理汇总了Java中tech.tablesaw.api.Table.shortColumn方法的典型用法代码示例。如果您正苦于以下问题:Java Table.shortColumn方法的具体用法?Java Table.shortColumn怎么用?Java Table.shortColumn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tech.tablesaw.api.Table
的用法示例。
在下文中一共展示了Table.shortColumn方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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);
}
示例2: apply
import tech.tablesaw.api.Table; //导入方法依赖的package包/类
public Selection apply(Table relation) {
String name = columnReference.getColumnName();
Column column = relation.column(name);
ColumnType type = column.type();
switch (type) {
case INTEGER:
IntColumn intColumn = relation.intColumn(name);
return intColumn.isGreaterThanOrEqualTo(value);
case LONG_INT:
LongColumn longColumn = relation.longColumn(name);
return longColumn.isGreaterThanOrEqualTo(value);
case SHORT_INT:
ShortColumn shortColumn = relation.shortColumn(name);
return shortColumn.isGreaterThanOrEqualTo(value);
default:
throw new UnsupportedOperationException("Columns of type " + type.name() + " do not support the operation "
+ "greaterThanOrEqualTo(anInt) ");
}
}
示例3: apply
import tech.tablesaw.api.Table; //导入方法依赖的package包/类
public Selection apply(Table relation) {
String name = columnReference.getColumnName();
Column column = relation.column(name);
ColumnType type = column.type();
switch (type) {
case INTEGER:
IntColumn intColumn = relation.intColumn(name);
return intColumn.isLessThanOrEqualTo(value);
case LONG_INT:
LongColumn longColumn = relation.longColumn(name);
return longColumn.isLessThanOrEqualTo(value);
case SHORT_INT:
ShortColumn shortColumn = relation.shortColumn(name);
return shortColumn.isLessThanOrEqualTo(value);
default:
throw new UnsupportedOperationException("Columns of type " + type.name() + " do not support the operation "
+ "lessThanOrEqualTo(anInt) ");
}
}
示例4: apply
import tech.tablesaw.api.Table; //导入方法依赖的package包/类
public Selection apply(Table relation) {
String name = columnReference.getColumnName();
Column column = relation.column(name);
ColumnType type = column.type();
switch (type) {
case INTEGER:
IntColumn intColumn = relation.intColumn(name);
return intColumn.isLessThan(value);
case LONG_INT:
LongColumn longColumn = relation.longColumn(name);
return longColumn.isLessThan(value);
case SHORT_INT:
ShortColumn shortColumn = relation.shortColumn(name);
return shortColumn.isLessThan(value);
default:
throw new UnsupportedOperationException("Columns of type " + type.name() + " do not support the operation "
+ "lessThan(anInt) ");
}
}
示例5: apply
import tech.tablesaw.api.Table; //导入方法依赖的package包/类
public Selection apply(Table relation) {
String name = columnReference.getColumnName();
Column column = relation.column(name);
ColumnType type = column.type();
switch (type) {
case INTEGER:
IntColumn intColumn = relation.intColumn(name);
return intColumn.isGreaterThan(value);
case LONG_INT:
LongColumn longColumn = relation.longColumn(name);
return longColumn.isGreaterThan(value);
case SHORT_INT:
ShortColumn shortColumn = relation.shortColumn(name);
return shortColumn.isGreaterThan(value);
default:
throw new UnsupportedOperationException("Columns of type " + type.name() + " do not support the operation "
+ "greaterThan(anInt) ");
}
}
示例6: testReadFailure2
import tech.tablesaw.api.Table; //导入方法依赖的package包/类
@Test
public void testReadFailure2() throws Exception {
Table table1 = Table.read().csv("../data/read_failure_test2.csv");
table1.structure(); // just make sure the import completed
ShortColumn test = table1.shortColumn("Test");
//TODO(lwhite): Better tests
assertNotNull(test.summary());
}
示例7: testReadFailure
import tech.tablesaw.api.Table; //导入方法依赖的package包/类
@Test
public void testReadFailure() throws Exception {
Table table1 = Table.read().csv("../data/read_failure_test.csv");
table1.structure(); // just make sure the import completed
ShortColumn test = table1.shortColumn("Test");
//TODO(lwhite): Better tests
assertNotNull(test.summary());
}
示例8: 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());
}
}