当前位置: 首页>>代码示例>>Java>>正文


Java Table类代码示例

本文整理汇总了Java中tech.tablesaw.api.Table的典型用法代码示例。如果您正苦于以下问题:Java Table类的具体用法?Java Table怎么用?Java Table使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Table类属于tech.tablesaw.api包,在下文中一共展示了Table类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: register

import tech.tablesaw.api.Table; //导入依赖的package包/类
public static void register() {
  Displayers.register(Table.class, new Displayer<Table>() {
    @Override
    public Map<String, String> display(Table table) {
      new TableDisplay(
              table.rowCount(),
              table.columnCount(),
              table.columnNames(),
              new TableDisplay.Element() {
                @Override
                public String get(int columnIndex, int rowIndex) {
                  return table.get(rowIndex,columnIndex);
                }
              }
      ).display();
      return OutputCell.DISPLAYER_HIDDEN;
    }
  });

}
 
开发者ID:jtablesaw,项目名称:tablesaw,代码行数:21,代码来源:TablesawDisplayer.java

示例2: apply

import tech.tablesaw.api.Table; //导入依赖的package包/类
@Override
public Selection apply(Table relation) {
    String name = columnReference().getColumnName();
    Column column = relation.column(name);
    ColumnType type = column.type();
    switch (type) {
        case LOCAL_DATE:
            DateColumn dateColumn = relation.dateColumn(name);
            return dateColumn.isInQ3();
        case LOCAL_DATE_TIME:
            DateTimeColumn dateTimeColumn = relation.dateTimeColumn(name);
            return dateTimeColumn.isInQ3();
        default:
            throw new UnsupportedOperationException("Columns of type " + type.name() + " do not support the operation "
                    + "isInQ3() ");
    }
}
 
开发者ID:jtablesaw,项目名称:tablesaw,代码行数:18,代码来源:IsInQ3.java

示例3: apply

import tech.tablesaw.api.Table; //导入依赖的package包/类
@Override
public Selection apply(Table relation) {

    String name = columnReference().getColumnName();
    Column column = relation.column(name);
    ColumnType type = column.type();
    switch (type) {
        case LOCAL_DATE:
            DateColumn dateColumn = relation.dateColumn(name);
            return dateColumn.isFirstDayOfMonth();
        case LOCAL_DATE_TIME:
            DateTimeColumn dateTimeColumn = relation.dateTimeColumn(name);
            return dateTimeColumn.isFirstDayOfMonth();
        default:
            throw new UnsupportedOperationException("Columns of type " + type.name() + " do not support the operation "
                    + "isFirstDayOfTheMonth() ");
    }
}
 
开发者ID:jtablesaw,项目名称:tablesaw,代码行数:19,代码来源:IsFirstDayOfTheMonth.java

示例4: apply

import tech.tablesaw.api.Table; //导入依赖的package包/类
@Override
public Selection apply(Table relation) {

    String name = columnReference().getColumnName();
    Column column = relation.column(name);
    ColumnType type = column.type();
    switch (type) {
        case LOCAL_TIME:
            TimeColumn timeColumn = relation.timeColumn(name);
            return timeColumn.isMidnight();
        case LOCAL_DATE_TIME:
            DateTimeColumn dateTimeColumn = relation.dateTimeColumn(name);
            return dateTimeColumn.isMidnight();
        default:
            throw new UnsupportedOperationException("Columns of type " + type.name() + " do not support the operation "
                    + "isMidnight() ");
    }
}
 
开发者ID:jtablesaw,项目名称:tablesaw,代码行数:19,代码来源:IsMidnight.java

示例5: apply

import tech.tablesaw.api.Table; //导入依赖的package包/类
@Override
public Selection apply(Table relation) {
    String name = columnReference().getColumnName();
    Column column = relation.column(name);
    ColumnType type = column.type();
    switch (type) {
        case LOCAL_DATE:
            DateColumn dateColumn = relation.dateColumn(name);
            return dateColumn.isTuesday();
        case LOCAL_DATE_TIME:
            DateTimeColumn dateTimeColumn = relation.dateTimeColumn(name);
            return dateTimeColumn.isTuesday();
        default:
            throw new UnsupportedOperationException("Columns of type " + type.name() + " do not support the operation "
                    + "isTuesday() ");
    }
}
 
开发者ID:jtablesaw,项目名称:tablesaw,代码行数:18,代码来源:IsTuesday.java

示例6: apply

import tech.tablesaw.api.Table; //导入依赖的package包/类
@Override
public Selection apply(Table relation) {
    String name = columnReference().getColumnName();
    Column column = relation.column(name);
    ColumnType type = column.type();
    switch (type) {
        case LOCAL_DATE:
            DateColumn dateColumn = relation.dateColumn(name);
            return dateColumn.isInDecember();
        case LOCAL_DATE_TIME:
            DateTimeColumn dateTimeColumn = relation.dateTimeColumn(name);
            return dateTimeColumn.isInDecember();
        default:
            throw new UnsupportedOperationException("Columns of type " + type.name() + " do not support the operation "
                    + "isInDecember() ");
    }
}
 
开发者ID:jtablesaw,项目名称:tablesaw,代码行数:18,代码来源:IsInDecember.java

示例7: apply

import tech.tablesaw.api.Table; //导入依赖的package包/类
@Override
public Selection apply(Table relation) {
    String name = columnReference().getColumnName();
    Column column = relation.column(name);
    ColumnType type = column.type();
    switch (type) {
        case LOCAL_DATE:
            DateColumn dateColumn = relation.dateColumn(name);
            return dateColumn.isInQ4();
        case LOCAL_DATE_TIME:
            DateTimeColumn dateTimeColumn = relation.dateTimeColumn(name);
            return dateTimeColumn.isInQ4();
        default:
            throw new UnsupportedOperationException("Columns of type " + type.name() + " do not support the operation "
                    + "isInQ4() ");
    }
}
 
开发者ID:jtablesaw,项目名称:tablesaw,代码行数:18,代码来源:IsInQ4.java

示例8: apply

import tech.tablesaw.api.Table; //导入依赖的package包/类
@Override
public Selection apply(Table relation) {
    String name = columnReference().getColumnName();
    Column column = relation.column(name);
    ColumnType type = column.type();
    switch (type) {
        case LOCAL_DATE:
            DateColumn dateColumn = relation.dateColumn(name);
            return dateColumn.isInAugust();
        case LOCAL_DATE_TIME:
            DateTimeColumn dateTimeColumn = relation.dateTimeColumn(name);
            return dateTimeColumn.isInAugust();
        default:
            throw new UnsupportedOperationException("Columns of type " + type.name() + " do not support the operation "
                    + "isInAugust() ");
    }
}
 
开发者ID:jtablesaw,项目名称:tablesaw,代码行数:18,代码来源:IsInAugust.java

示例9: FrequentItemset

import tech.tablesaw.api.Table; //导入依赖的package包/类
public FrequentItemset(ShortColumn sets, ShortColumn items, double support) {

        Table temp = Table.create("temp");
        temp.addColumn(sets.copy());
        temp.addColumn(items.copy());
        temp.sortAscendingOn(sets.name(), items.name());

        ViewGroup baskets = temp.splitOn(temp.column(0));

        this.setCount = baskets.size();

        int[][] itemsets = new int[setCount][];
        int basketIndex = 0;
        for (TemporaryView basket : baskets) {
            ShortRBTreeSet set = new ShortRBTreeSet(basket.shortColumn(1).data());
            int itemIndex = 0;
            itemsets[basketIndex] = new int[set.size()];
            for (short item : set) {
                itemsets[basketIndex][itemIndex] = item;
                itemIndex++;
            }
            basketIndex++;
        }

        this.model = new FPGrowth(itemsets, support);
    }
 
开发者ID:jtablesaw,项目名称:tablesaw,代码行数:27,代码来源:FrequentItemset.java

示例10: 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);
    }
 
开发者ID:jtablesaw,项目名称:tablesaw,代码行数:23,代码来源:AssociationRuleMiningExample.java

示例11: testAsTable

import tech.tablesaw.api.Table; //导入依赖的package包/类
@Test
public void testAsTable() throws Exception {

    Table example = Table.read().csv("../data/KNN_Example_1.csv");

    Table[] splits = example.sampleSplit(.5);
    Table train = splits[0];
    Table test = splits[1];

    KNN<double[]> knn = KNN.learn(
            DoubleArrays.to2dArray(train.nCol("X"), train.nCol("Y")),
            train.shortColumn(2).toIntArray(), 2);

    int[] predicted = new int[test.rowCount()];
    SortedSet<Object> lableSet = new TreeSet<>(train.shortColumn(2).asSet());
    ConfusionMatrix confusion = new StandardConfusionMatrix(lableSet);
    for (int row : test) {
        double[] data = new double[2];
        data[0] = test.floatColumn(0).getFloat(row);
        data[1] = test.floatColumn(1).getFloat(row);
        predicted[row] = knn.predict(data);
        confusion.increment((int) test.shortColumn(2).get(row), predicted[row]);
    }
}
 
开发者ID:jtablesaw,项目名称:tablesaw,代码行数:25,代码来源:ConfusionMatrixTest.java

示例12: apply

import tech.tablesaw.api.Table; //导入依赖的package包/类
@Override
public Selection apply(Table relation) {
    String name = columnReference().getColumnName();
    Column column = relation.column(name);
    ColumnType type = column.type();
    switch (type) {
        case LOCAL_DATE:
            DateColumn dateColumn = relation.dateColumn(name);
            return dateColumn.isInJune();
        case LOCAL_DATE_TIME:
            DateTimeColumn dateTimeColumn = relation.dateTimeColumn(name);
            return dateTimeColumn.isInJune();
        default:
            throw new UnsupportedOperationException("Columns of type " + type.name() + " do not support the operation "
                    + "isInJune() ");
    }
}
 
开发者ID:jtablesaw,项目名称:tablesaw,代码行数:18,代码来源:IsInJune.java

示例13: apply

import tech.tablesaw.api.Table; //导入依赖的package包/类
@Override
public Selection apply(Table relation) {

    String name = columnReference().getColumnName();
    Column column = relation.column(name);
    ColumnType type = column.type();
    switch (type) {
        case LOCAL_TIME:
            TimeColumn timeColumn = relation.timeColumn(name);
            return timeColumn.isAfterNoon();
        case LOCAL_DATE_TIME:
            DateTimeColumn dateTimeColumn = relation.dateTimeColumn(name);
            return dateTimeColumn.isAfterNoon();
        default:
            throw new UnsupportedOperationException("Columns of type " + type.name() + " do not support the operation "
                    + "isAfterNoon() ");
    }
}
 
开发者ID:jtablesaw,项目名称:tablesaw,代码行数:19,代码来源:IsAfterNoon.java

示例14: apply

import tech.tablesaw.api.Table; //导入依赖的package包/类
@Override
public Selection apply(Table relation) {
    String name = columnReference().getColumnName();
    Column column = relation.column(name);
    ColumnType type = column.type();
    switch (type) {
        case LOCAL_DATE:
            DateColumn dateColumn = relation.dateColumn(name);
            return dateColumn.isThursday();
        case LOCAL_DATE_TIME:
            DateTimeColumn dateTimeColumn = relation.dateTimeColumn(name);
            return dateTimeColumn.isThursday();
        default:
            throw new UnsupportedOperationException("Columns of type " + type.name() + " do not support the operation "
                    + "isThursday() ");
    }
}
 
开发者ID:jtablesaw,项目名称:tablesaw,代码行数:18,代码来源:IsThursday.java

示例15: apply

import tech.tablesaw.api.Table; //导入依赖的package包/类
@Override
public Selection apply(Table relation) {
    String name = columnReference().getColumnName();
    Column column = relation.column(name);
    ColumnType type = column.type();
    switch (type) {
        case LOCAL_DATE:
            DateColumn dateColumn = relation.dateColumn(name);
            return dateColumn.isWednesday();
        case LOCAL_DATE_TIME:
            DateTimeColumn dateTimeColumn = relation.dateTimeColumn(name);
            return dateTimeColumn.isWednesday();
        default:
            throw new UnsupportedOperationException("Columns of type " + type.name() + " do not support the operation "
                    + "isWednesday() ");
    }
}
 
开发者ID:jtablesaw,项目名称:tablesaw,代码行数:18,代码来源:IsWednesday.java


注:本文中的tech.tablesaw.api.Table类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。