本文整理了Java中org.ujmp.core.Matrix.sum()
方法的一些代码示例,展示了Matrix.sum()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Matrix.sum()
方法的具体详情如下:
包路径:org.ujmp.core.Matrix
类名称:Matrix
方法名:sum
暂无
代码示例来源:origin: jdmp/java-data-mining-package
public Map<String, Object> calculateObjects(Map<String, Object> input) {
int dimension = defaultDimension;
boolean ignoreNaN = defaultIgnoreNaN;
Map<String, Object> result = new HashMap<String, Object>();
Matrix source = MathUtil.getMatrix(input.get(SOURCE));
Object o2 = input.get(DIMENSION);
if (o2 != null) {
dimension = MathUtil.getInt(o2);
}
Object o3 = input.get(IGNORENAN);
if (o3 != null) {
ignoreNaN = MathUtil.getBoolean(o3);
}
Matrix target = source.sum(Ret.NEW, dimension, ignoreNaN);
result.put(TARGET, target);
return result;
}
代码示例来源:origin: ujmp/universal-java-matrix-package
public Object call() {
Matrix result = getMatrixObject().getMatrix().sum(Ret.NEW, getDimension(), getIgnoreMissing());
return result;
}
代码示例来源:origin: ujmp/universal-java-matrix-package
private void calculate() {
docTerm = new DocTerm(getSource()).calcNew();
if (calculateTf) {
sumPerDoc = docTerm.sum(Ret.NEW, Matrix.COLUMN, true);
}
if (calculateIdf) {
sumPerTerm = docTerm.toBooleanMatrix().sum(Ret.NEW, Matrix.ROW, true);
}
}
代码示例来源:origin: jdmp/java-data-mining-package
@Test
public void testClusteringKMeans() throws Exception {
ListDataSet iris = ListDataSet.Factory.IRIS();
WekaClusterer wc = new WekaClusterer(WekaClustererType.SimpleKMeans, false);
wc.setNumberOfClusters(3);
wc.train(iris);
wc.predict(iris);
Matrix result = iris.getPredictedMatrix().sum(Ret.NEW, Matrix.ROW, true);
// the three classes should have approximately 50 samples each
assertEquals(50, result.getAsDouble(0, 0), 15);
assertEquals(50, result.getAsDouble(0, 1), 15);
assertEquals(50, result.getAsDouble(0, 2), 15);
}
代码示例来源:origin: jdmp/java-data-mining-package
@Test
public void testClusteringEM() throws Exception {
ListDataSet iris = ListDataSet.Factory.IRIS();
WekaClusterer wc = new WekaClusterer(WekaClustererType.EM, false);
wc.setNumberOfClusters(3);
wc.train(iris);
wc.predict(iris);
Matrix result = iris.getPredictedMatrix().sum(Ret.NEW, Matrix.ROW, true);
// the three classes should have approximately 50 samples each
assertEquals(50, result.getAsDouble(0, 0), 15);
assertEquals(50, result.getAsDouble(0, 1), 15);
assertEquals(50, result.getAsDouble(0, 2), 15);
}
内容来源于网络,如有侵权,请联系作者删除!