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

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

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

Matrix.max介绍

暂无

代码示例

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

public Object call() {
  Matrix result = getMatrixObject().getMatrix().max(Ret.NEW, getDimension());
  return result;
}

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

private void calculate() {
  min = getSource().min(Ret.NEW, getDimension());
  max = getSource().max(Ret.NEW, getDimension());
}

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

public static DefaultSparseObjectMatrix fromNonZeros(Matrix nonZeros) {
  final Matrix max = nonZeros.max(Ret.NEW, Matrix.ROW);
  final long valueCount = nonZeros.getRowCount();
  final long rowCount = max.getAsLong(0, 0);
  final long columnCount = max.getAsLong(0, 1);
  DefaultSparseObjectMatrix m = new DefaultSparseObjectMatrix(rowCount, columnCount);
  for (int r = 0; r < valueCount; r++) {
    long[] c = new long[2];
    c[0] = nonZeros.getAsLong(r, 0);
    c[1] = nonZeros.getAsLong(r, 1);
    Coordinates co = Coordinates.wrap(c);
    Object val = nonZeros.getAsObject(r, 2);
    m.values.put(co, val);
  }
  return m;
}

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

public void trainAll(ListDataSet dataSet) {
  Matrix dataSetInput = dataSet.getInputMatrix();
  Matrix max = dataSetInput.max(Ret.NEW, Matrix.ROW);
  cumSum = new ArrayList<Integer>((int) max.getColumnCount());
  int sum = 0;
  cumSum.add(sum);
  for (int i = (int) max.getColumnCount() - 1; i != -1; i--) {
    sum += max.getAsInt(0, i) + 1;
    cumSum.add(sum);
  }
  LabelAlphabet inputAlphabet = new LabelAlphabet();
  int featureCount = getFeatureCount(dataSet);
  for (int i = 0; i < featureCount; i++) {
    // iterate from 1 to max (inclusive!)
    for (int fv = 1; fv < max.getAsDouble(0, i) + 1; fv++) {
      inputAlphabet.lookupIndex("Feature" + i + "=" + fv, true);
    }
  }
  LabelAlphabet targetAlphabet = new LabelAlphabet();
  for (int i = 0; i < dataSet.getTargetMatrix().getColumnCount(); i++) {
    targetAlphabet.lookupIndex("Class" + i, true);
  }
  InstanceList trainingSet = new DataSet2InstanceList(dataSet, inputAlphabet, targetAlphabet, cumSum);
  classifier = trainer.train(trainingSet);
}

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

mins.add(min);
Matrix max = data.max(Ret.NEW, Matrix.ROW);
max.setLabel(m.getLabel() + "-" + benchmarkName + "-max");
max.setMetaDataDimensionMatrix(Matrix.ROW, columnLabels);

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

Matrix valueCounts = dataSet.getInputMatrix().max(Ret.NEW, Matrix.ROW).plus(1);
for (int j = 0; j < dataSet.getInputMatrix().getColumnCount(); j++) {
  weka.core.Attribute a = null;

相关文章

Matrix类方法