本文整理汇总了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());
}
示例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());
}
示例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);
}
示例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);
}
示例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);
}
示例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")));
}
示例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");
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}