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

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

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

Matrix.countMissing介绍

暂无

代码示例

代码示例来源:origin: ujmp/universal-java-matrix-package

long missingCount = (long) x.countMissing(Ret.NEW, Matrix.ALL).getEuklideanValue();
double percent = ((int) Math.round((missingCount * 1000.0 / valueCount))) / 10.0;
System.out.println("missing values: " + missingCount + " (" + percent + "%)");

代码示例来源:origin: jdmp/java-data-mining-package

double missingValueCount = transposedInput.countMissing(Ret.NEW, ALL).doubleValue();

代码示例来源:origin: ujmp/universal-java-matrix-package

@Test
public final void test0Divide0Matrix() throws Exception {
  Matrix m1 = createMatrixWithAnnotation(5, 7);
  Matrix m2 = createMatrixWithAnnotation(5, 7);
  Matrix m3 = m1.divide(m2);
  assertEquals(getLabel(), 35, m3.countMissing(Ret.NEW, Matrix.ALL).intValue());
  if (m1 instanceof Erasable) {
    ((Erasable) m1).erase();
  }
  if (m2 instanceof Erasable) {
    ((Erasable) m2).erase();
  }
  if (m3 instanceof Erasable) {
    ((Erasable) m3).erase();
  }
}

代码示例来源:origin: ujmp/universal-java-matrix-package

@Test
public final void testXDivide0Matrix() throws Exception {
  Matrix m1 = createMatrixWithAnnotation(5, 7);
  Matrix m2 = createMatrixWithAnnotation(5, 7);
  m1.randn(Ret.ORIG);
  Matrix m3 = m1.divide(m2);
  assertEquals(getLabel(), 35, m3.countMissing(Ret.NEW, Matrix.ALL).intValue());
  if (m1 instanceof Erasable) {
    ((Erasable) m1).erase();
  }
  if (m2 instanceof Erasable) {
    ((Erasable) m2).erase();
  }
  if (m3 instanceof Erasable) {
    ((Erasable) m3).erase();
  }
}

代码示例来源:origin: ujmp/universal-java-matrix-package

@Test
public final void testCountMissingValues() throws Exception {
  Matrix m = createMatrixWithAnnotation(4, 4);
  m = m.zeros(Ret.ORIG);
  m.setAsDouble(Double.NaN, 1, 0);
  m.setAsDouble(Double.NaN, 3, 0);
  m.setAsDouble(Double.NaN, 2, 1);
  m.setAsDouble(Double.NaN, 1, 1);
  m.setAsDouble(Double.NaN, 3, 1);
  m.setAsDouble(Double.NaN, 1, 2);
  Matrix m1 = m.countMissing(Ret.NEW, Matrix.ROW);
  Matrix m2 = m.countMissing(Ret.NEW, Matrix.COLUMN);
  Matrix m3 = m.countMissing(Ret.NEW, Matrix.ALL);
  assertEquals(getLabel(), 2.0, m1.getAsDouble(0, 0), TOLERANCE);
  assertEquals(getLabel(), 3.0, m1.getAsDouble(0, 1), TOLERANCE);
  assertEquals(getLabel(), 1.0, m1.getAsDouble(0, 2), TOLERANCE);
  assertEquals(getLabel(), 0.0, m1.getAsDouble(0, 3), TOLERANCE);
  assertEquals(getLabel(), 0.0, m2.getAsDouble(0, 0), TOLERANCE);
  assertEquals(getLabel(), 3.0, m2.getAsDouble(1, 0), TOLERANCE);
  assertEquals(getLabel(), 1.0, m2.getAsDouble(2, 0), TOLERANCE);
  assertEquals(getLabel(), 2.0, m2.getAsDouble(3, 0), TOLERANCE);
  assertEquals(getLabel(), 6.0, m3.getAsDouble(0, 0), TOLERANCE);
  if (m instanceof Erasable) {
    ((Erasable) m).erase();
  }
}

相关文章

Matrix类方法