org.ujmp.core.Matrix.sum()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(2.2k)|赞(0)|评价(0)|浏览(140)

本文整理了Java中org.ujmp.core.Matrix.sum()方法的一些代码示例,展示了Matrix.sum()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Matrix.sum()方法的具体详情如下:
包路径:org.ujmp.core.Matrix
类名称:Matrix
方法名:sum

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);
}

相关文章

Matrix类方法