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

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

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

Matrix.toRowVector介绍

暂无

代码示例

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

public int getTargetClass() {
  return (int) getAsMatrix(TARGET).toRowVector(Ret.NEW).getCoordinatesOfMaximum()[ROW];
}

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

public int getRecognizedClass() {
  return (int) getAsMatrix(PREDICTED).toRowVector(Ret.NEW).getCoordinatesOfMaximum()[ROW];
}

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

public int getFeatureCount(ListDataSet dataSet) {
  return (int) dataSet.iterator().next().getAsMatrix(getInputLabel()).toRowVector(Ret.NEW)
      .getRowCount();
}

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

public int getFeatureCount(ListDataSet dataSet) {
  return (int) dataSet.iterator().next().getAsMatrix(getInputLabel()).toRowVector(Ret.NEW)
      .getRowCount();
}

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

public int getFeatureCount(ListDataSet dataSet) {
  return (int) dataSet.iterator().next().getAsMatrix(getInputLabel()).toRowVector(Ret.NEW)
      .getRowCount();
}

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

public void trainOne(Matrix input, Matrix sampleWeight, Matrix desiredOutput) {
  addDesiredOutputMatrix(desiredOutput.toRowVector(Ret.NEW));
  if (sampleWeight == null) {
    sampleWeight = Matrix.Factory.linkToValue(1.0);
  }
  setSampleWeight(sampleWeight.doubleValue());
  predictOne(input);
  getOutputErrorAlgorithm().calculate();
  for (int i = networkLayers.size() - 1; i != -1; i--) {
    networkLayers.get(i).calculateBackward();
  }
  for (int i = networkLayers.size() - 1; i != -1; i--) {
    networkLayers.get(i).calculateWeightUpdate();
  }
}

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

public int getClassCount(ListDataSet dataSet) {
  return (int) dataSet.get(0).getAsMatrix(getTargetLabel()).toRowVector(Ret.NEW)
      .getRowCount();
}

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

public SampleToInstanceWrapper(Matrix input, Matrix sampleWeight, Matrix targetOutput,
    boolean discrete, boolean includeTarget) {
  super((int) input.toRowVector(Ret.LINK).getRowCount() + 1);
  input = input.toRowVector(Ret.LINK);
  if (sampleWeight != null) {
    setWeight(sampleWeight.doubleValue());
  } else {
    setWeight(1.0);
  }
  for (int i = 0; i < input.getRowCount(); i++) {
    if (discrete) {
      setValue(i, (int) input.getAsDouble(i, 0));
    } else {
      setValue(i, input.getAsDouble(i, 0));
    }
  }
  if (includeTarget && targetOutput != null) {
    long[] c = targetOutput.toRowVector(Ret.NEW).getCoordinatesOfMaximum();
    setValue((int) input.getRowCount(), c[Matrix.ROW]);
  }
}

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

Matrix input = s.getAsMatrix(getInputLabel()).toColumnVector(Ret.NEW);
if (svmType == SVMType.EPSILON_SVR || svmType == SVMType.NU_SVR) {
  prob.y[i] = s.getAsMatrix(getTargetLabel()).toRowVector(Ret.NEW).getAsDouble(0, 0);
} else {
  int targetClass = (int) s.getAsMatrix(getTargetLabel()).toRowVector(Ret.NEW)
      .getCoordinatesOfMaximum()[ROW];
  prob.y[i] = targetClass;

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

Matrix x = MathUtil.getMatrix(input.get(SOURCE2)).toRowVector(Ret.NEW);

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

public Matrix predictOne(Matrix input) {
  input = input.toRowVector(Ret.NEW);

相关文章

Matrix类方法