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


Java Table.nCol方法代码示例

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


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

示例1: main

import tech.tablesaw.api.Table; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {

        Table t = Table.read().csv("../data/whiskey.csv");

        Gmeans model = new Gmeans(
                10,
                t.nCol(2),
                t.nCol(3),
                t.nCol(4),
                t.nCol(5),
                t.nCol(6),
                t.nCol(7),
                t.nCol(8),
                t.nCol(9),
                t.nCol(10),
                t.nCol(11),
                t.nCol(12),
                t.nCol(13)
        );

        out("Distortion: " + model.distortion());
        out("Cluster count: " + model.getClusterCount());
        out(Arrays.toString(model.getClusterLabels()));
        out(Arrays.toString(model.getClusterSizes()));
        out(model.labeledCentroids());
    }
 
开发者ID:jtablesaw,项目名称:tablesaw,代码行数:27,代码来源:GmeansExample.java

示例2: main

import tech.tablesaw.api.Table; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {

        Table t = Table.read().csv("../data/whiskey.csv");

        Xmeans model = new Xmeans(
                10,
                t.nCol(2),
                t.nCol(3),
                t.nCol(4),
                t.nCol(5),
                t.nCol(6),
                t.nCol(7),
                t.nCol(8),
                t.nCol(9),
                t.nCol(10),
                t.nCol(11),
                t.nCol(12),
                t.nCol(13)
        );

        out("Distortion: " + model.distortion());
        out("Cluster count: " + model.getClusterCount());
        out(Arrays.toString(model.getClusterLabels()));
        out(Arrays.toString(model.getClusterSizes()));
        out(model.labeledCentroids());
    }
 
开发者ID:jtablesaw,项目名称:tablesaw,代码行数:27,代码来源:XmeansExample.java

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

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

示例5: main

import tech.tablesaw.api.Table; //导入方法依赖的package包/类
public static void main(String[] args) throws IOException {
    Table baseball = Table.read().csv("../data/market_share.csv");
    Table sub = baseball.selectRows(0, 10);
    NumericColumn x = sub.nCol("Products");
    NumericColumn y = sub.nCol("Sales");
    NumericColumn data = sub.nCol("Market_Share");
    Bubble.show("Market Share", x, y, data);
}
 
开发者ID:jtablesaw,项目名称:tablesaw,代码行数:9,代码来源:BubbleExample.java

示例6: main

import tech.tablesaw.api.Table; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
    Table baseball = Table.read().csv("../data/baseball.csv");
    NumericColumn x = baseball.nCol("BA");
    NumericColumn y = baseball.nCol("W");
    Scatter.show(x, y);

    Scatter.show("Regular season wins by year",
            baseball.numericColumn("W"),
            baseball.numericColumn("Year"),
            baseball.splitOn(baseball.column("Playoffs")));
}
 
开发者ID:jtablesaw,项目名称:tablesaw,代码行数:12,代码来源:ScatterplotExample.java

示例7: main

import tech.tablesaw.api.Table; //导入方法依赖的package包/类
public static void main(String[] args) throws IOException {
    Table t = Table.read().csv("../data/whiskey.csv");

    Kmeans model = new Kmeans(
            5,
            t.nCol(2),
            t.nCol(3),
            t.nCol(4),
            t.nCol(5),
            t.nCol(6),
            t.nCol(7),
            t.nCol(8),
            t.nCol(9),
            t.nCol(10),
            t.nCol(11),
            t.nCol(12),
            t.nCol(13)
    );

    out("Distortion: " + model.distortion());
    out("Cluster count: " + model.getClusterCount());
    out(Arrays.toString(model.getClusterLabels()));
    out(Arrays.toString(model.getClusterSizes()));

    //out(model.clustered(t.column(1)).printHtml());

    out(model.labeledCentroids());

    int n = t.rowCount();
    double[] kValues = new double[n - 2];
    double[] distortions = new double[n - 2];

    for (int k = 2; k < n; k++) {
        kValues[k - 2] = k;
        Kmeans kmeans = new Kmeans(k,
                t.nCol(2),
                t.nCol(3),
                t.nCol(4),
                t.nCol(5),
                t.nCol(6),
                t.nCol(7),
                t.nCol(8),
                t.nCol(9),
                t.nCol(10),
                t.nCol(11),
                t.nCol(12),
                t.nCol(13)
        );
        distortions[k - 2] = kmeans.distortion();
    }
    Scatter.show(kValues, "k", distortions, "distortion");
}
 
开发者ID:jtablesaw,项目名称:tablesaw,代码行数:53,代码来源:KmeansExample.java

示例8: main

import tech.tablesaw.api.Table; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
    Table baseball = Table.read().csv("../data/baseball.csv");
    NumericColumn x = baseball.nCol("BA");
    Histogram.show("Distribution of team batting averages", x);
}
 
开发者ID:jtablesaw,项目名称:tablesaw,代码行数:6,代码来源:HistogramExample.java

示例9: main

import tech.tablesaw.api.Table; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
    Table baseball = Table.read().csv("../data/baseball.csv");
    NumericColumn x = baseball.nCol("BA");
    Quantile.show("Distribution of team batting averages", x);
}
 
开发者ID:jtablesaw,项目名称:tablesaw,代码行数:6,代码来源:QuantileExample.java

示例10: main

import tech.tablesaw.api.Table; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
    Table baseball = Table.read().csv("../data/boston-robberies.csv");
    NumericColumn x = baseball.nCol("Record");
    NumericColumn y = baseball.nCol("Robberies");
    Line.show("Monthly Boston Armed Robberies Jan. 1966 - Oct. 1975", x, y);
}
 
开发者ID:jtablesaw,项目名称:tablesaw,代码行数:7,代码来源:LinePlotExample.java

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


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