[refactor] move java package to namespace java
This commit is contained in:
parent
ae969a0e69
commit
e8560c7909
@ -29,5 +29,5 @@
|
|||||||
|
|
||||||
<suppressions>
|
<suppressions>
|
||||||
<suppress checks=".*"
|
<suppress checks=".*"
|
||||||
files="xgboost4j/src/main/java/ml/dmlc/xgboost4j/java/XgboostJNI.java"/>
|
files="xgboost4j/src/main/java/ml/dmlc/xgboost4j/java/XGBoostJNI.java"/>
|
||||||
</suppressions>
|
</suppressions>
|
||||||
|
|||||||
@ -19,10 +19,11 @@ import java.util.ArrayList;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import ml.dmlc.xgboost4j.java.*;
|
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
|
||||||
|
import ml.dmlc.xgboost4j.java.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* an example user define objective and eval
|
* an example user define objective and eval
|
||||||
* NOTE: when you do customized loss function, the default prediction value is margin
|
* NOTE: when you do customized loss function, the default prediction value is margin
|
||||||
|
|||||||
@ -4,10 +4,10 @@ import java.io.IOException;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import ml.dmlc.xgboost4j.java.*;
|
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
|
||||||
|
import ml.dmlc.xgboost4j.java.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Distributed training example, used to quick test distributed training.
|
* Distributed training example, used to quick test distributed training.
|
||||||
|
|||||||
@ -16,7 +16,8 @@
|
|||||||
|
|
||||||
package ml.dmlc.xgboost4j.flink
|
package ml.dmlc.xgboost4j.flink
|
||||||
|
|
||||||
import ml.dmlc.xgboost4j.java.{RabitTracker, Rabit}
|
import ml.dmlc.xgboost4j.java.{Rabit,RabitTracker}
|
||||||
|
|
||||||
import ml.dmlc.xgboost4j.scala.Booster
|
import ml.dmlc.xgboost4j.scala.Booster
|
||||||
import ml.dmlc.xgboost4j.scala.DMatrix
|
import ml.dmlc.xgboost4j.scala.DMatrix
|
||||||
import ml.dmlc.xgboost4j.scala.XGBoost
|
import ml.dmlc.xgboost4j.scala.XGBoost
|
||||||
@ -34,7 +35,7 @@ class ScalaMapFunction(workerEnvs: java.util.Map[String, String])
|
|||||||
extends RichMapPartitionFunction[LabeledVector, Booster] {
|
extends RichMapPartitionFunction[LabeledVector, Booster] {
|
||||||
val log = LogFactory.getLog(this.getClass)
|
val log = LogFactory.getLog(this.getClass)
|
||||||
def mapPartition(it : java.lang.Iterable[LabeledVector], collector: Collector[Booster]): Unit = {
|
def mapPartition(it : java.lang.Iterable[LabeledVector], collector: Collector[Booster]): Unit = {
|
||||||
workerEnvs.put("DMLC_TASK_ID", this.getRuntimeContext.getTaskName)
|
workerEnvs.put("DMLC_TASK_ID", String.valueOf(this.getRuntimeContext.getIndexOfThisSubtask))
|
||||||
log.info("start with env" + workerEnvs.toString)
|
log.info("start with env" + workerEnvs.toString)
|
||||||
Rabit.init(workerEnvs)
|
Rabit.init(workerEnvs)
|
||||||
|
|
||||||
|
|||||||
@ -65,7 +65,7 @@ public class DMatrix {
|
|||||||
logger.info(e.toString());
|
logger.info(e.toString());
|
||||||
}
|
}
|
||||||
long[] out = new long[1];
|
long[] out = new long[1];
|
||||||
JNIErrorHandle.checkCall(XgboostJNI.XGDMatrixCreateFromDataIter(iter, cache_info, out));
|
JNIErrorHandle.checkCall(XGBoostJNI.XGDMatrixCreateFromDataIter(iter, cache_info, out));
|
||||||
handle = out[0];
|
handle = out[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -80,7 +80,7 @@ public class DMatrix {
|
|||||||
throw new NullPointerException("dataPath: null");
|
throw new NullPointerException("dataPath: null");
|
||||||
}
|
}
|
||||||
long[] out = new long[1];
|
long[] out = new long[1];
|
||||||
JNIErrorHandle.checkCall(XgboostJNI.XGDMatrixCreateFromFile(dataPath, 1, out));
|
JNIErrorHandle.checkCall(XGBoostJNI.XGDMatrixCreateFromFile(dataPath, 1, out));
|
||||||
handle = out[0];
|
handle = out[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -95,9 +95,9 @@ public class DMatrix {
|
|||||||
public DMatrix(long[] headers, int[] indices, float[] data, SparseType st) throws XGBoostError {
|
public DMatrix(long[] headers, int[] indices, float[] data, SparseType st) throws XGBoostError {
|
||||||
long[] out = new long[1];
|
long[] out = new long[1];
|
||||||
if (st == SparseType.CSR) {
|
if (st == SparseType.CSR) {
|
||||||
JNIErrorHandle.checkCall(XgboostJNI.XGDMatrixCreateFromCSR(headers, indices, data, out));
|
JNIErrorHandle.checkCall(XGBoostJNI.XGDMatrixCreateFromCSR(headers, indices, data, out));
|
||||||
} else if (st == SparseType.CSC) {
|
} else if (st == SparseType.CSC) {
|
||||||
JNIErrorHandle.checkCall(XgboostJNI.XGDMatrixCreateFromCSC(headers, indices, data, out));
|
JNIErrorHandle.checkCall(XGBoostJNI.XGDMatrixCreateFromCSC(headers, indices, data, out));
|
||||||
} else {
|
} else {
|
||||||
throw new UnknownError("unknow sparsetype");
|
throw new UnknownError("unknow sparsetype");
|
||||||
}
|
}
|
||||||
@ -114,7 +114,7 @@ public class DMatrix {
|
|||||||
*/
|
*/
|
||||||
public DMatrix(float[] data, int nrow, int ncol) throws XGBoostError {
|
public DMatrix(float[] data, int nrow, int ncol) throws XGBoostError {
|
||||||
long[] out = new long[1];
|
long[] out = new long[1];
|
||||||
JNIErrorHandle.checkCall(XgboostJNI.XGDMatrixCreateFromMat(data, nrow, ncol, 0.0f, out));
|
JNIErrorHandle.checkCall(XGBoostJNI.XGDMatrixCreateFromMat(data, nrow, ncol, 0.0f, out));
|
||||||
handle = out[0];
|
handle = out[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -133,7 +133,7 @@ public class DMatrix {
|
|||||||
* @throws XGBoostError native error
|
* @throws XGBoostError native error
|
||||||
*/
|
*/
|
||||||
public void setLabel(float[] labels) throws XGBoostError {
|
public void setLabel(float[] labels) throws XGBoostError {
|
||||||
JNIErrorHandle.checkCall(XgboostJNI.XGDMatrixSetFloatInfo(handle, "label", labels));
|
JNIErrorHandle.checkCall(XGBoostJNI.XGDMatrixSetFloatInfo(handle, "label", labels));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -143,7 +143,7 @@ public class DMatrix {
|
|||||||
* @throws XGBoostError native error
|
* @throws XGBoostError native error
|
||||||
*/
|
*/
|
||||||
public void setWeight(float[] weights) throws XGBoostError {
|
public void setWeight(float[] weights) throws XGBoostError {
|
||||||
JNIErrorHandle.checkCall(XgboostJNI.XGDMatrixSetFloatInfo(handle, "weight", weights));
|
JNIErrorHandle.checkCall(XGBoostJNI.XGDMatrixSetFloatInfo(handle, "weight", weights));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -154,7 +154,7 @@ public class DMatrix {
|
|||||||
* @throws XGBoostError native error
|
* @throws XGBoostError native error
|
||||||
*/
|
*/
|
||||||
public void setBaseMargin(float[] baseMargin) throws XGBoostError {
|
public void setBaseMargin(float[] baseMargin) throws XGBoostError {
|
||||||
JNIErrorHandle.checkCall(XgboostJNI.XGDMatrixSetFloatInfo(handle, "base_margin", baseMargin));
|
JNIErrorHandle.checkCall(XGBoostJNI.XGDMatrixSetFloatInfo(handle, "base_margin", baseMargin));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -176,18 +176,18 @@ public class DMatrix {
|
|||||||
* @throws XGBoostError native error
|
* @throws XGBoostError native error
|
||||||
*/
|
*/
|
||||||
public void setGroup(int[] group) throws XGBoostError {
|
public void setGroup(int[] group) throws XGBoostError {
|
||||||
JNIErrorHandle.checkCall(XgboostJNI.XGDMatrixSetGroup(handle, group));
|
JNIErrorHandle.checkCall(XGBoostJNI.XGDMatrixSetGroup(handle, group));
|
||||||
}
|
}
|
||||||
|
|
||||||
private float[] getFloatInfo(String field) throws XGBoostError {
|
private float[] getFloatInfo(String field) throws XGBoostError {
|
||||||
float[][] infos = new float[1][];
|
float[][] infos = new float[1][];
|
||||||
JNIErrorHandle.checkCall(XgboostJNI.XGDMatrixGetFloatInfo(handle, field, infos));
|
JNIErrorHandle.checkCall(XGBoostJNI.XGDMatrixGetFloatInfo(handle, field, infos));
|
||||||
return infos[0];
|
return infos[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
private int[] getIntInfo(String field) throws XGBoostError {
|
private int[] getIntInfo(String field) throws XGBoostError {
|
||||||
int[][] infos = new int[1][];
|
int[][] infos = new int[1][];
|
||||||
JNIErrorHandle.checkCall(XgboostJNI.XGDMatrixGetUIntInfo(handle, field, infos));
|
JNIErrorHandle.checkCall(XGBoostJNI.XGDMatrixGetUIntInfo(handle, field, infos));
|
||||||
return infos[0];
|
return infos[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -230,7 +230,7 @@ public class DMatrix {
|
|||||||
*/
|
*/
|
||||||
public DMatrix slice(int[] rowIndex) throws XGBoostError {
|
public DMatrix slice(int[] rowIndex) throws XGBoostError {
|
||||||
long[] out = new long[1];
|
long[] out = new long[1];
|
||||||
JNIErrorHandle.checkCall(XgboostJNI.XGDMatrixSliceDMatrix(handle, rowIndex, out));
|
JNIErrorHandle.checkCall(XGBoostJNI.XGDMatrixSliceDMatrix(handle, rowIndex, out));
|
||||||
long sHandle = out[0];
|
long sHandle = out[0];
|
||||||
DMatrix sMatrix = new DMatrix(sHandle);
|
DMatrix sMatrix = new DMatrix(sHandle);
|
||||||
return sMatrix;
|
return sMatrix;
|
||||||
@ -244,7 +244,7 @@ public class DMatrix {
|
|||||||
*/
|
*/
|
||||||
public long rowNum() throws XGBoostError {
|
public long rowNum() throws XGBoostError {
|
||||||
long[] rowNum = new long[1];
|
long[] rowNum = new long[1];
|
||||||
JNIErrorHandle.checkCall(XgboostJNI.XGDMatrixNumRow(handle, rowNum));
|
JNIErrorHandle.checkCall(XGBoostJNI.XGDMatrixNumRow(handle, rowNum));
|
||||||
return rowNum[0];
|
return rowNum[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -252,7 +252,7 @@ public class DMatrix {
|
|||||||
* save DMatrix to filePath
|
* save DMatrix to filePath
|
||||||
*/
|
*/
|
||||||
public void saveBinary(String filePath) {
|
public void saveBinary(String filePath) {
|
||||||
XgboostJNI.XGDMatrixSaveBinary(handle, filePath, 1);
|
XGBoostJNI.XGDMatrixSaveBinary(handle, filePath, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -285,7 +285,7 @@ public class DMatrix {
|
|||||||
|
|
||||||
public synchronized void dispose() {
|
public synchronized void dispose() {
|
||||||
if (handle != 0) {
|
if (handle != 0) {
|
||||||
XgboostJNI.XGDMatrixFree(handle);
|
XGBoostJNI.XGDMatrixFree(handle);
|
||||||
handle = 0;
|
handle = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -45,7 +45,7 @@ class JNIErrorHandle {
|
|||||||
*/
|
*/
|
||||||
static void checkCall(int ret) throws XGBoostError {
|
static void checkCall(int ret) throws XGBoostError {
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
throw new XGBoostError(XgboostJNI.XGBGetLastError());
|
throw new XGBoostError(XGBoostJNI.XGBGetLastError());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -81,7 +81,7 @@ class JavaBoosterImpl implements Booster {
|
|||||||
handles = dmatrixsToHandles(dMatrixs);
|
handles = dmatrixsToHandles(dMatrixs);
|
||||||
}
|
}
|
||||||
long[] out = new long[1];
|
long[] out = new long[1];
|
||||||
JNIErrorHandle.checkCall(XgboostJNI.XGBoosterCreate(handles, out));
|
JNIErrorHandle.checkCall(XGBoostJNI.XGBoosterCreate(handles, out));
|
||||||
|
|
||||||
handle = out[0];
|
handle = out[0];
|
||||||
}
|
}
|
||||||
@ -94,7 +94,7 @@ class JavaBoosterImpl implements Booster {
|
|||||||
* @throws XGBoostError native error
|
* @throws XGBoostError native error
|
||||||
*/
|
*/
|
||||||
public final void setParam(String key, String value) throws XGBoostError {
|
public final void setParam(String key, String value) throws XGBoostError {
|
||||||
JNIErrorHandle.checkCall(XgboostJNI.XGBoosterSetParam(handle, key, value));
|
JNIErrorHandle.checkCall(XGBoostJNI.XGBoosterSetParam(handle, key, value));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -120,7 +120,7 @@ class JavaBoosterImpl implements Booster {
|
|||||||
* @throws XGBoostError native error
|
* @throws XGBoostError native error
|
||||||
*/
|
*/
|
||||||
public void update(DMatrix dtrain, int iter) throws XGBoostError {
|
public void update(DMatrix dtrain, int iter) throws XGBoostError {
|
||||||
JNIErrorHandle.checkCall(XgboostJNI.XGBoosterUpdateOneIter(handle, iter, dtrain.getHandle()));
|
JNIErrorHandle.checkCall(XGBoostJNI.XGBoosterUpdateOneIter(handle, iter, dtrain.getHandle()));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -149,7 +149,7 @@ class JavaBoosterImpl implements Booster {
|
|||||||
throw new AssertionError(String.format("grad/hess length mismatch %s / %s", grad.length,
|
throw new AssertionError(String.format("grad/hess length mismatch %s / %s", grad.length,
|
||||||
hess.length));
|
hess.length));
|
||||||
}
|
}
|
||||||
JNIErrorHandle.checkCall(XgboostJNI.XGBoosterBoostOneIter(handle, dtrain.getHandle(), grad,
|
JNIErrorHandle.checkCall(XGBoostJNI.XGBoosterBoostOneIter(handle, dtrain.getHandle(), grad,
|
||||||
hess));
|
hess));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -165,7 +165,7 @@ class JavaBoosterImpl implements Booster {
|
|||||||
public String evalSet(DMatrix[] evalMatrixs, String[] evalNames, int iter) throws XGBoostError {
|
public String evalSet(DMatrix[] evalMatrixs, String[] evalNames, int iter) throws XGBoostError {
|
||||||
long[] handles = dmatrixsToHandles(evalMatrixs);
|
long[] handles = dmatrixsToHandles(evalMatrixs);
|
||||||
String[] evalInfo = new String[1];
|
String[] evalInfo = new String[1];
|
||||||
JNIErrorHandle.checkCall(XgboostJNI.XGBoosterEvalOneIter(handle, iter, handles, evalNames,
|
JNIErrorHandle.checkCall(XGBoostJNI.XGBoosterEvalOneIter(handle, iter, handles, evalNames,
|
||||||
evalInfo));
|
evalInfo));
|
||||||
return evalInfo[0];
|
return evalInfo[0];
|
||||||
}
|
}
|
||||||
@ -211,7 +211,7 @@ class JavaBoosterImpl implements Booster {
|
|||||||
optionMask = 2;
|
optionMask = 2;
|
||||||
}
|
}
|
||||||
float[][] rawPredicts = new float[1][];
|
float[][] rawPredicts = new float[1][];
|
||||||
JNIErrorHandle.checkCall(XgboostJNI.XGBoosterPredict(handle, data.getHandle(), optionMask,
|
JNIErrorHandle.checkCall(XGBoostJNI.XGBoosterPredict(handle, data.getHandle(), optionMask,
|
||||||
treeLimit, rawPredicts));
|
treeLimit, rawPredicts));
|
||||||
int row = (int) data.rowNum();
|
int row = (int) data.rowNum();
|
||||||
int col = rawPredicts[0].length / row;
|
int col = rawPredicts[0].length / row;
|
||||||
@ -284,11 +284,11 @@ class JavaBoosterImpl implements Booster {
|
|||||||
* @param modelPath model path
|
* @param modelPath model path
|
||||||
*/
|
*/
|
||||||
public void saveModel(String modelPath) throws XGBoostError{
|
public void saveModel(String modelPath) throws XGBoostError{
|
||||||
JNIErrorHandle.checkCall(XgboostJNI.XGBoosterSaveModel(handle, modelPath));
|
JNIErrorHandle.checkCall(XGBoostJNI.XGBoosterSaveModel(handle, modelPath));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void loadModel(String modelPath) {
|
private void loadModel(String modelPath) {
|
||||||
XgboostJNI.XGBoosterLoadModel(handle, modelPath);
|
XGBoostJNI.XGBoosterLoadModel(handle, modelPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -304,7 +304,7 @@ class JavaBoosterImpl implements Booster {
|
|||||||
statsFlag = 1;
|
statsFlag = 1;
|
||||||
}
|
}
|
||||||
String[][] modelInfos = new String[1][];
|
String[][] modelInfos = new String[1][];
|
||||||
JNIErrorHandle.checkCall(XgboostJNI.XGBoosterDumpModel(handle, "", statsFlag, modelInfos));
|
JNIErrorHandle.checkCall(XGBoostJNI.XGBoosterDumpModel(handle, "", statsFlag, modelInfos));
|
||||||
return modelInfos[0];
|
return modelInfos[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -322,7 +322,7 @@ class JavaBoosterImpl implements Booster {
|
|||||||
statsFlag = 1;
|
statsFlag = 1;
|
||||||
}
|
}
|
||||||
String[][] modelInfos = new String[1][];
|
String[][] modelInfos = new String[1][];
|
||||||
JNIErrorHandle.checkCall(XgboostJNI.XGBoosterDumpModel(handle, featureMap, statsFlag,
|
JNIErrorHandle.checkCall(XGBoostJNI.XGBoosterDumpModel(handle, featureMap, statsFlag,
|
||||||
modelInfos));
|
modelInfos));
|
||||||
return modelInfos[0];
|
return modelInfos[0];
|
||||||
}
|
}
|
||||||
@ -450,7 +450,7 @@ class JavaBoosterImpl implements Booster {
|
|||||||
*/
|
*/
|
||||||
public byte[] toByteArray() throws XGBoostError {
|
public byte[] toByteArray() throws XGBoostError {
|
||||||
byte[][] bytes = new byte[1][];
|
byte[][] bytes = new byte[1][];
|
||||||
JNIErrorHandle.checkCall(XgboostJNI.XGBoosterGetModelRaw(this.handle, bytes));
|
JNIErrorHandle.checkCall(XGBoostJNI.XGBoosterGetModelRaw(this.handle, bytes));
|
||||||
return bytes[0];
|
return bytes[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -463,7 +463,7 @@ class JavaBoosterImpl implements Booster {
|
|||||||
*/
|
*/
|
||||||
int loadRabitCheckpoint() throws XGBoostError {
|
int loadRabitCheckpoint() throws XGBoostError {
|
||||||
int[] out = new int[1];
|
int[] out = new int[1];
|
||||||
JNIErrorHandle.checkCall(XgboostJNI.XGBoosterLoadRabitCheckpoint(this.handle, out));
|
JNIErrorHandle.checkCall(XGBoostJNI.XGBoosterLoadRabitCheckpoint(this.handle, out));
|
||||||
return out[0];
|
return out[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -473,7 +473,7 @@ class JavaBoosterImpl implements Booster {
|
|||||||
* @throws XGBoostError
|
* @throws XGBoostError
|
||||||
*/
|
*/
|
||||||
void saveRabitCheckpoint() throws XGBoostError {
|
void saveRabitCheckpoint() throws XGBoostError {
|
||||||
JNIErrorHandle.checkCall(XgboostJNI.XGBoosterSaveRabitCheckpoint(this.handle));
|
JNIErrorHandle.checkCall(XGBoostJNI.XGBoosterSaveRabitCheckpoint(this.handle));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -504,7 +504,7 @@ class JavaBoosterImpl implements Booster {
|
|||||||
try {
|
try {
|
||||||
this.init(null);
|
this.init(null);
|
||||||
byte[] bytes = (byte[])in.readObject();
|
byte[] bytes = (byte[])in.readObject();
|
||||||
JNIErrorHandle.checkCall(XgboostJNI.XGBoosterLoadModelFromBuffer(this.handle, bytes));
|
JNIErrorHandle.checkCall(XGBoostJNI.XGBoosterLoadModelFromBuffer(this.handle, bytes));
|
||||||
} catch (XGBoostError ex) {
|
} catch (XGBoostError ex) {
|
||||||
throw new IOException(ex.toString());
|
throw new IOException(ex.toString());
|
||||||
}
|
}
|
||||||
@ -518,7 +518,7 @@ class JavaBoosterImpl implements Booster {
|
|||||||
|
|
||||||
public synchronized void dispose() {
|
public synchronized void dispose() {
|
||||||
if (handle != 0L) {
|
if (handle != 0L) {
|
||||||
XgboostJNI.XGBoosterFree(handle);
|
XGBoostJNI.XGBoosterFree(handle);
|
||||||
handle = 0;
|
handle = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,7 +23,7 @@ public class Rabit {
|
|||||||
|
|
||||||
private static void checkCall(int ret) throws XGBoostError {
|
private static void checkCall(int ret) throws XGBoostError {
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
throw new XGBoostError(XgboostJNI.XGBGetLastError());
|
throw new XGBoostError(XGBoostJNI.XGBGetLastError());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -38,7 +38,7 @@ public class Rabit {
|
|||||||
for (java.util.Map.Entry<String, String> e : envs.entrySet()) {
|
for (java.util.Map.Entry<String, String> e : envs.entrySet()) {
|
||||||
args[idx++] = e.getKey() + '=' + e.getValue();
|
args[idx++] = e.getKey() + '=' + e.getValue();
|
||||||
}
|
}
|
||||||
checkCall(XgboostJNI.RabitInit(args));
|
checkCall(XGBoostJNI.RabitInit(args));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -46,7 +46,7 @@ public class Rabit {
|
|||||||
* @throws XGBoostError
|
* @throws XGBoostError
|
||||||
*/
|
*/
|
||||||
public static void shutdown() throws XGBoostError {
|
public static void shutdown() throws XGBoostError {
|
||||||
checkCall(XgboostJNI.RabitFinalize());
|
checkCall(XGBoostJNI.RabitFinalize());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -55,7 +55,7 @@ public class Rabit {
|
|||||||
* @throws XGBoostError
|
* @throws XGBoostError
|
||||||
*/
|
*/
|
||||||
public static void trackerPrint(String msg) throws XGBoostError {
|
public static void trackerPrint(String msg) throws XGBoostError {
|
||||||
checkCall(XgboostJNI.RabitTrackerPrint(msg));
|
checkCall(XGBoostJNI.RabitTrackerPrint(msg));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -66,7 +66,7 @@ public class Rabit {
|
|||||||
*/
|
*/
|
||||||
public static int versionNumber() throws XGBoostError {
|
public static int versionNumber() throws XGBoostError {
|
||||||
int[] out = new int[1];
|
int[] out = new int[1];
|
||||||
checkCall(XgboostJNI.RabitVersionNumber(out));
|
checkCall(XGBoostJNI.RabitVersionNumber(out));
|
||||||
return out[0];
|
return out[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -77,7 +77,7 @@ public class Rabit {
|
|||||||
*/
|
*/
|
||||||
public static int getRank() throws XGBoostError {
|
public static int getRank() throws XGBoostError {
|
||||||
int[] out = new int[1];
|
int[] out = new int[1];
|
||||||
checkCall(XgboostJNI.RabitGetRank(out));
|
checkCall(XGBoostJNI.RabitGetRank(out));
|
||||||
return out[0];
|
return out[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -88,7 +88,7 @@ public class Rabit {
|
|||||||
*/
|
*/
|
||||||
public static int getWorldSize() throws XGBoostError {
|
public static int getWorldSize() throws XGBoostError {
|
||||||
int[] out = new int[1];
|
int[] out = new int[1];
|
||||||
checkCall(XgboostJNI.RabitGetWorldSize(out));
|
checkCall(XGBoostJNI.RabitGetWorldSize(out));
|
||||||
return out[0];
|
return out[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,7 +22,7 @@ package ml.dmlc.xgboost4j.java;
|
|||||||
*
|
*
|
||||||
* @author hzx
|
* @author hzx
|
||||||
*/
|
*/
|
||||||
class XgboostJNI {
|
class XGBoostJNI {
|
||||||
public final static native String XGBGetLastError();
|
public final static native String XGBGetLastError();
|
||||||
|
|
||||||
public final static native int XGDMatrixCreateFromFile(String fname, int silent, long[] out);
|
public final static native int XGDMatrixCreateFromFile(String fname, int silent, long[] out);
|
||||||
|
|||||||
@ -21,7 +21,6 @@ import _root_.scala.collection.JavaConverters._
|
|||||||
import ml.dmlc.xgboost4j.java.{DMatrix => JDMatrix, DataBatch, XGBoostError}
|
import ml.dmlc.xgboost4j.java.{DMatrix => JDMatrix, DataBatch, XGBoostError}
|
||||||
|
|
||||||
class DMatrix private[scala](private[scala] val jDMatrix: JDMatrix) {
|
class DMatrix private[scala](private[scala] val jDMatrix: JDMatrix) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* init DMatrix from file (svmlight format)
|
* init DMatrix from file (svmlight format)
|
||||||
*
|
*
|
||||||
|
|||||||
@ -16,10 +16,11 @@
|
|||||||
|
|
||||||
package ml.dmlc.xgboost4j.scala
|
package ml.dmlc.xgboost4j.scala
|
||||||
|
|
||||||
import ml.dmlc.xgboost4j.java
|
|
||||||
import ml.dmlc.xgboost4j.java.IObjective
|
|
||||||
import scala.collection.JavaConverters._
|
import scala.collection.JavaConverters._
|
||||||
|
|
||||||
|
import ml.dmlc.xgboost4j.java.{DMatrix => JDMatrix}
|
||||||
|
import ml.dmlc.xgboost4j.java.IObjective
|
||||||
|
|
||||||
trait ObjectiveTrait extends IObjective {
|
trait ObjectiveTrait extends IObjective {
|
||||||
/**
|
/**
|
||||||
* user define objective function, return gradient and second order gradient
|
* user define objective function, return gradient and second order gradient
|
||||||
@ -30,7 +31,7 @@ trait ObjectiveTrait extends IObjective {
|
|||||||
*/
|
*/
|
||||||
def getGradient(predicts: Array[Array[Float]], dtrain: DMatrix): List[Array[Float]]
|
def getGradient(predicts: Array[Array[Float]], dtrain: DMatrix): List[Array[Float]]
|
||||||
|
|
||||||
private[scala] def getGradient(predicts: Array[Array[Float]], dtrain: java.DMatrix):
|
private[scala] def getGradient(predicts: Array[Array[Float]], dtrain: JDMatrix):
|
||||||
java.util.List[Array[Float]] = {
|
java.util.List[Array[Float]] = {
|
||||||
getGradient(predicts, new DMatrix(dtrain)).asJava
|
getGradient(predicts, new DMatrix(dtrain)).asJava
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
package ml.dmlc.xgboost4j.scala
|
package ml.dmlc.xgboost4j.scala
|
||||||
|
|
||||||
|
import ml.dmlc.xgboost4j.java.{XGBoost => JXGBoost}
|
||||||
import scala.collection.JavaConverters._
|
import scala.collection.JavaConverters._
|
||||||
|
|
||||||
object XGBoost {
|
object XGBoost {
|
||||||
|
|||||||
@ -134,11 +134,11 @@ XGB_EXTERN_C int XGBoost4jCallbackDataIterNext(
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: XGBGetLastError
|
* Method: XGBGetLastError
|
||||||
* Signature: ()Ljava/lang/String;
|
* Signature: ()Ljava/lang/String;
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jstring JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBGetLastError
|
JNIEXPORT jstring JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_XGBGetLastError
|
||||||
(JNIEnv *jenv, jclass jcls) {
|
(JNIEnv *jenv, jclass jcls) {
|
||||||
jstring jresult = 0;
|
jstring jresult = 0;
|
||||||
const char* result = XGBGetLastError();
|
const char* result = XGBGetLastError();
|
||||||
@ -149,11 +149,11 @@ JNIEXPORT jstring JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBGetLastError
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: XGDMatrixCreateFromDataIter
|
* Method: XGDMatrixCreateFromDataIter
|
||||||
* Signature: (Ljava/util/Iterator;Ljava/lang/String;[J)I
|
* Signature: (Ljava/util/Iterator;Ljava/lang/String;[J)I
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixCreateFromDataIter
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_XGDMatrixCreateFromDataIter
|
||||||
(JNIEnv *jenv, jclass jcls, jobject jiter, jstring jcache_info, jlongArray jout) {
|
(JNIEnv *jenv, jclass jcls, jobject jiter, jstring jcache_info, jlongArray jout) {
|
||||||
DMatrixHandle result;
|
DMatrixHandle result;
|
||||||
const char* cache_info = nullptr;
|
const char* cache_info = nullptr;
|
||||||
@ -170,11 +170,11 @@ JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixCreateFromData
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: XGDMatrixCreateFromFile
|
* Method: XGDMatrixCreateFromFile
|
||||||
* Signature: (Ljava/lang/String;I[J)I
|
* Signature: (Ljava/lang/String;I[J)I
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixCreateFromFile
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_XGDMatrixCreateFromFile
|
||||||
(JNIEnv *jenv, jclass jcls, jstring jfname, jint jsilent, jlongArray jout) {
|
(JNIEnv *jenv, jclass jcls, jstring jfname, jint jsilent, jlongArray jout) {
|
||||||
DMatrixHandle result;
|
DMatrixHandle result;
|
||||||
const char* fname = jenv->GetStringUTFChars(jfname, 0);
|
const char* fname = jenv->GetStringUTFChars(jfname, 0);
|
||||||
@ -187,11 +187,11 @@ JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixCreateFromFile
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: XGDMatrixCreateFromCSR
|
* Method: XGDMatrixCreateFromCSR
|
||||||
* Signature: ([J[J[F)J
|
* Signature: ([J[J[F)J
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixCreateFromCSR
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_XGDMatrixCreateFromCSR
|
||||||
(JNIEnv *jenv, jclass jcls, jlongArray jindptr, jintArray jindices, jfloatArray jdata, jlongArray jout) {
|
(JNIEnv *jenv, jclass jcls, jlongArray jindptr, jintArray jindices, jfloatArray jdata, jlongArray jout) {
|
||||||
DMatrixHandle result;
|
DMatrixHandle result;
|
||||||
jlong* indptr = jenv->GetLongArrayElements(jindptr, 0);
|
jlong* indptr = jenv->GetLongArrayElements(jindptr, 0);
|
||||||
@ -209,11 +209,11 @@ JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixCreateFromCSR
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: XGDMatrixCreateFromCSC
|
* Method: XGDMatrixCreateFromCSC
|
||||||
* Signature: ([J[J[F)J
|
* Signature: ([J[J[F)J
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixCreateFromCSC
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_XGDMatrixCreateFromCSC
|
||||||
(JNIEnv *jenv, jclass jcls, jlongArray jindptr, jintArray jindices, jfloatArray jdata, jlongArray jout) {
|
(JNIEnv *jenv, jclass jcls, jlongArray jindptr, jintArray jindices, jfloatArray jdata, jlongArray jout) {
|
||||||
DMatrixHandle result;
|
DMatrixHandle result;
|
||||||
jlong* indptr = jenv->GetLongArrayElements(jindptr, NULL);
|
jlong* indptr = jenv->GetLongArrayElements(jindptr, NULL);
|
||||||
@ -233,11 +233,11 @@ JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixCreateFromCSC
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: XGDMatrixCreateFromMat
|
* Method: XGDMatrixCreateFromMat
|
||||||
* Signature: ([FIIF)J
|
* Signature: ([FIIF)J
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixCreateFromMat
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_XGDMatrixCreateFromMat
|
||||||
(JNIEnv *jenv, jclass jcls, jfloatArray jdata, jint jnrow, jint jncol, jfloat jmiss, jlongArray jout) {
|
(JNIEnv *jenv, jclass jcls, jfloatArray jdata, jint jnrow, jint jncol, jfloat jmiss, jlongArray jout) {
|
||||||
DMatrixHandle result;
|
DMatrixHandle result;
|
||||||
jfloat* data = jenv->GetFloatArrayElements(jdata, 0);
|
jfloat* data = jenv->GetFloatArrayElements(jdata, 0);
|
||||||
@ -251,11 +251,11 @@ JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixCreateFromMat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: XGDMatrixSliceDMatrix
|
* Method: XGDMatrixSliceDMatrix
|
||||||
* Signature: (J[I)J
|
* Signature: (J[I)J
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixSliceDMatrix
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_XGDMatrixSliceDMatrix
|
||||||
(JNIEnv *jenv, jclass jcls, jlong jhandle, jintArray jindexset, jlongArray jout) {
|
(JNIEnv *jenv, jclass jcls, jlong jhandle, jintArray jindexset, jlongArray jout) {
|
||||||
DMatrixHandle result;
|
DMatrixHandle result;
|
||||||
DMatrixHandle handle = (DMatrixHandle) jhandle;
|
DMatrixHandle handle = (DMatrixHandle) jhandle;
|
||||||
@ -272,11 +272,11 @@ JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixSliceDMatrix
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: XGDMatrixFree
|
* Method: XGDMatrixFree
|
||||||
* Signature: (J)V
|
* Signature: (J)V
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixFree
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_XGDMatrixFree
|
||||||
(JNIEnv *jenv, jclass jcls, jlong jhandle) {
|
(JNIEnv *jenv, jclass jcls, jlong jhandle) {
|
||||||
DMatrixHandle handle = (DMatrixHandle) jhandle;
|
DMatrixHandle handle = (DMatrixHandle) jhandle;
|
||||||
int ret = XGDMatrixFree(handle);
|
int ret = XGDMatrixFree(handle);
|
||||||
@ -284,11 +284,11 @@ JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixFree
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: XGDMatrixSaveBinary
|
* Method: XGDMatrixSaveBinary
|
||||||
* Signature: (JLjava/lang/String;I)V
|
* Signature: (JLjava/lang/String;I)V
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixSaveBinary
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_XGDMatrixSaveBinary
|
||||||
(JNIEnv *jenv, jclass jcls, jlong jhandle, jstring jfname, jint jsilent) {
|
(JNIEnv *jenv, jclass jcls, jlong jhandle, jstring jfname, jint jsilent) {
|
||||||
DMatrixHandle handle = (DMatrixHandle) jhandle;
|
DMatrixHandle handle = (DMatrixHandle) jhandle;
|
||||||
const char* fname = jenv->GetStringUTFChars(jfname, 0);
|
const char* fname = jenv->GetStringUTFChars(jfname, 0);
|
||||||
@ -298,11 +298,11 @@ JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixSaveBinary
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: XGDMatrixSetFloatInfo
|
* Method: XGDMatrixSetFloatInfo
|
||||||
* Signature: (JLjava/lang/String;[F)V
|
* Signature: (JLjava/lang/String;[F)V
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixSetFloatInfo
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_XGDMatrixSetFloatInfo
|
||||||
(JNIEnv *jenv, jclass jcls, jlong jhandle, jstring jfield, jfloatArray jarray) {
|
(JNIEnv *jenv, jclass jcls, jlong jhandle, jstring jfield, jfloatArray jarray) {
|
||||||
DMatrixHandle handle = (DMatrixHandle) jhandle;
|
DMatrixHandle handle = (DMatrixHandle) jhandle;
|
||||||
const char* field = jenv->GetStringUTFChars(jfield, 0);
|
const char* field = jenv->GetStringUTFChars(jfield, 0);
|
||||||
@ -317,11 +317,11 @@ JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixSetFloatInfo
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: XGDMatrixSetUIntInfo
|
* Method: XGDMatrixSetUIntInfo
|
||||||
* Signature: (JLjava/lang/String;[I)V
|
* Signature: (JLjava/lang/String;[I)V
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixSetUIntInfo
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_XGDMatrixSetUIntInfo
|
||||||
(JNIEnv *jenv, jclass jcls, jlong jhandle, jstring jfield, jintArray jarray) {
|
(JNIEnv *jenv, jclass jcls, jlong jhandle, jstring jfield, jintArray jarray) {
|
||||||
DMatrixHandle handle = (DMatrixHandle) jhandle;
|
DMatrixHandle handle = (DMatrixHandle) jhandle;
|
||||||
const char* field = jenv->GetStringUTFChars(jfield, 0);
|
const char* field = jenv->GetStringUTFChars(jfield, 0);
|
||||||
@ -336,11 +336,11 @@ JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixSetUIntInfo
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: XGDMatrixSetGroup
|
* Method: XGDMatrixSetGroup
|
||||||
* Signature: (J[I)V
|
* Signature: (J[I)V
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixSetGroup
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_XGDMatrixSetGroup
|
||||||
(JNIEnv * jenv, jclass jcls, jlong jhandle, jintArray jarray) {
|
(JNIEnv * jenv, jclass jcls, jlong jhandle, jintArray jarray) {
|
||||||
DMatrixHandle handle = (DMatrixHandle) jhandle;
|
DMatrixHandle handle = (DMatrixHandle) jhandle;
|
||||||
jint* array = jenv->GetIntArrayElements(jarray, NULL);
|
jint* array = jenv->GetIntArrayElements(jarray, NULL);
|
||||||
@ -352,11 +352,11 @@ JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixSetGroup
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: XGDMatrixGetFloatInfo
|
* Method: XGDMatrixGetFloatInfo
|
||||||
* Signature: (JLjava/lang/String;)[F
|
* Signature: (JLjava/lang/String;)[F
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixGetFloatInfo
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_XGDMatrixGetFloatInfo
|
||||||
(JNIEnv *jenv, jclass jcls, jlong jhandle, jstring jfield, jobjectArray jout) {
|
(JNIEnv *jenv, jclass jcls, jlong jhandle, jstring jfield, jobjectArray jout) {
|
||||||
DMatrixHandle handle = (DMatrixHandle) jhandle;
|
DMatrixHandle handle = (DMatrixHandle) jhandle;
|
||||||
const char* field = jenv->GetStringUTFChars(jfield, 0);
|
const char* field = jenv->GetStringUTFChars(jfield, 0);
|
||||||
@ -374,11 +374,11 @@ JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixGetFloatInfo
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: XGDMatrixGetUIntInfo
|
* Method: XGDMatrixGetUIntInfo
|
||||||
* Signature: (JLjava/lang/String;)[I
|
* Signature: (JLjava/lang/String;)[I
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixGetUIntInfo
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_XGDMatrixGetUIntInfo
|
||||||
(JNIEnv *jenv, jclass jcls, jlong jhandle, jstring jfield, jobjectArray jout) {
|
(JNIEnv *jenv, jclass jcls, jlong jhandle, jstring jfield, jobjectArray jout) {
|
||||||
DMatrixHandle handle = (DMatrixHandle) jhandle;
|
DMatrixHandle handle = (DMatrixHandle) jhandle;
|
||||||
const char* field = jenv->GetStringUTFChars(jfield, 0);
|
const char* field = jenv->GetStringUTFChars(jfield, 0);
|
||||||
@ -395,11 +395,11 @@ JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixGetUIntInfo
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: XGDMatrixNumRow
|
* Method: XGDMatrixNumRow
|
||||||
* Signature: (J)J
|
* Signature: (J)J
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixNumRow
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_XGDMatrixNumRow
|
||||||
(JNIEnv *jenv, jclass jcls, jlong jhandle, jlongArray jout) {
|
(JNIEnv *jenv, jclass jcls, jlong jhandle, jlongArray jout) {
|
||||||
DMatrixHandle handle = (DMatrixHandle) jhandle;
|
DMatrixHandle handle = (DMatrixHandle) jhandle;
|
||||||
bst_ulong result[1];
|
bst_ulong result[1];
|
||||||
@ -409,11 +409,11 @@ JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixNumRow
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: XGBoosterCreate
|
* Method: XGBoosterCreate
|
||||||
* Signature: ([J)J
|
* Signature: ([J)J
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterCreate
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_XGBoosterCreate
|
||||||
(JNIEnv *jenv, jclass jcls, jlongArray jhandles, jlongArray jout) {
|
(JNIEnv *jenv, jclass jcls, jlongArray jhandles, jlongArray jout) {
|
||||||
std::vector<DMatrixHandle> handles;
|
std::vector<DMatrixHandle> handles;
|
||||||
if (jhandles != nullptr) {
|
if (jhandles != nullptr) {
|
||||||
@ -431,11 +431,11 @@ JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterCreate
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: XGBoosterFree
|
* Method: XGBoosterFree
|
||||||
* Signature: (J)V
|
* Signature: (J)V
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterFree
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_XGBoosterFree
|
||||||
(JNIEnv *jenv, jclass jcls, jlong jhandle) {
|
(JNIEnv *jenv, jclass jcls, jlong jhandle) {
|
||||||
BoosterHandle handle = (BoosterHandle) jhandle;
|
BoosterHandle handle = (BoosterHandle) jhandle;
|
||||||
return XGBoosterFree(handle);
|
return XGBoosterFree(handle);
|
||||||
@ -443,11 +443,11 @@ JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterFree
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: XGBoosterSetParam
|
* Method: XGBoosterSetParam
|
||||||
* Signature: (JLjava/lang/String;Ljava/lang/String;)V
|
* Signature: (JLjava/lang/String;Ljava/lang/String;)V
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterSetParam
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_XGBoosterSetParam
|
||||||
(JNIEnv *jenv, jclass jcls, jlong jhandle, jstring jname, jstring jvalue) {
|
(JNIEnv *jenv, jclass jcls, jlong jhandle, jstring jname, jstring jvalue) {
|
||||||
BoosterHandle handle = (BoosterHandle) jhandle;
|
BoosterHandle handle = (BoosterHandle) jhandle;
|
||||||
const char* name = jenv->GetStringUTFChars(jname, 0);
|
const char* name = jenv->GetStringUTFChars(jname, 0);
|
||||||
@ -460,11 +460,11 @@ JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterSetParam
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: XGBoosterUpdateOneIter
|
* Method: XGBoosterUpdateOneIter
|
||||||
* Signature: (JIJ)V
|
* Signature: (JIJ)V
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterUpdateOneIter
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_XGBoosterUpdateOneIter
|
||||||
(JNIEnv *jenv, jclass jcls, jlong jhandle, jint jiter, jlong jdtrain) {
|
(JNIEnv *jenv, jclass jcls, jlong jhandle, jint jiter, jlong jdtrain) {
|
||||||
BoosterHandle handle = (BoosterHandle) jhandle;
|
BoosterHandle handle = (BoosterHandle) jhandle;
|
||||||
DMatrixHandle dtrain = (DMatrixHandle) jdtrain;
|
DMatrixHandle dtrain = (DMatrixHandle) jdtrain;
|
||||||
@ -472,11 +472,11 @@ JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterUpdateOneIter
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: XGBoosterBoostOneIter
|
* Method: XGBoosterBoostOneIter
|
||||||
* Signature: (JJ[F[F)V
|
* Signature: (JJ[F[F)V
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterBoostOneIter
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_XGBoosterBoostOneIter
|
||||||
(JNIEnv *jenv, jclass jcls, jlong jhandle, jlong jdtrain, jfloatArray jgrad, jfloatArray jhess) {
|
(JNIEnv *jenv, jclass jcls, jlong jhandle, jlong jdtrain, jfloatArray jgrad, jfloatArray jhess) {
|
||||||
BoosterHandle handle = (BoosterHandle) jhandle;
|
BoosterHandle handle = (BoosterHandle) jhandle;
|
||||||
DMatrixHandle dtrain = (DMatrixHandle) jdtrain;
|
DMatrixHandle dtrain = (DMatrixHandle) jdtrain;
|
||||||
@ -491,11 +491,11 @@ JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterBoostOneIter
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: XGBoosterEvalOneIter
|
* Method: XGBoosterEvalOneIter
|
||||||
* Signature: (JI[J[Ljava/lang/String;)Ljava/lang/String;
|
* Signature: (JI[J[Ljava/lang/String;)Ljava/lang/String;
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterEvalOneIter
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_XGBoosterEvalOneIter
|
||||||
(JNIEnv *jenv, jclass jcls, jlong jhandle, jint jiter, jlongArray jdmats, jobjectArray jevnames, jobjectArray jout) {
|
(JNIEnv *jenv, jclass jcls, jlong jhandle, jint jiter, jlongArray jdmats, jobjectArray jevnames, jobjectArray jout) {
|
||||||
BoosterHandle handle = (BoosterHandle) jhandle;
|
BoosterHandle handle = (BoosterHandle) jhandle;
|
||||||
std::vector<DMatrixHandle> dmats;
|
std::vector<DMatrixHandle> dmats;
|
||||||
@ -530,11 +530,11 @@ JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterEvalOneIter
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: XGBoosterPredict
|
* Method: XGBoosterPredict
|
||||||
* Signature: (JJIJ)[F
|
* Signature: (JJIJ)[F
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterPredict
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_XGBoosterPredict
|
||||||
(JNIEnv *jenv, jclass jcls, jlong jhandle, jlong jdmat, jint joption_mask, jint jntree_limit, jobjectArray jout) {
|
(JNIEnv *jenv, jclass jcls, jlong jhandle, jlong jdmat, jint joption_mask, jint jntree_limit, jobjectArray jout) {
|
||||||
BoosterHandle handle = (BoosterHandle) jhandle;
|
BoosterHandle handle = (BoosterHandle) jhandle;
|
||||||
DMatrixHandle dmat = (DMatrixHandle) jdmat;
|
DMatrixHandle dmat = (DMatrixHandle) jdmat;
|
||||||
@ -550,11 +550,11 @@ JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterPredict
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: XGBoosterLoadModel
|
* Method: XGBoosterLoadModel
|
||||||
* Signature: (JLjava/lang/String;)V
|
* Signature: (JLjava/lang/String;)V
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterLoadModel
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_XGBoosterLoadModel
|
||||||
(JNIEnv *jenv, jclass jcls, jlong jhandle, jstring jfname) {
|
(JNIEnv *jenv, jclass jcls, jlong jhandle, jstring jfname) {
|
||||||
BoosterHandle handle = (BoosterHandle) jhandle;
|
BoosterHandle handle = (BoosterHandle) jhandle;
|
||||||
const char* fname = jenv->GetStringUTFChars(jfname, 0);
|
const char* fname = jenv->GetStringUTFChars(jfname, 0);
|
||||||
@ -565,11 +565,11 @@ JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterLoadModel
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: XGBoosterSaveModel
|
* Method: XGBoosterSaveModel
|
||||||
* Signature: (JLjava/lang/String;)V
|
* Signature: (JLjava/lang/String;)V
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterSaveModel
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_XGBoosterSaveModel
|
||||||
(JNIEnv *jenv, jclass jcls, jlong jhandle, jstring jfname) {
|
(JNIEnv *jenv, jclass jcls, jlong jhandle, jstring jfname) {
|
||||||
BoosterHandle handle = (BoosterHandle) jhandle;
|
BoosterHandle handle = (BoosterHandle) jhandle;
|
||||||
const char* fname = jenv->GetStringUTFChars(jfname, 0);
|
const char* fname = jenv->GetStringUTFChars(jfname, 0);
|
||||||
@ -580,11 +580,11 @@ JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterSaveModel
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: XGBoosterLoadModelFromBuffer
|
* Method: XGBoosterLoadModelFromBuffer
|
||||||
* Signature: (J[B)I
|
* Signature: (J[B)I
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterLoadModelFromBuffer
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_XGBoosterLoadModelFromBuffer
|
||||||
(JNIEnv *jenv, jclass jcls, jlong jhandle, jbyteArray jbytes) {
|
(JNIEnv *jenv, jclass jcls, jlong jhandle, jbyteArray jbytes) {
|
||||||
BoosterHandle handle = (BoosterHandle) jhandle;
|
BoosterHandle handle = (BoosterHandle) jhandle;
|
||||||
jbyte* buffer = jenv->GetByteArrayElements(jbytes, 0);
|
jbyte* buffer = jenv->GetByteArrayElements(jbytes, 0);
|
||||||
@ -595,11 +595,11 @@ JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterLoadModelFromB
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: XGBoosterGetModelRaw
|
* Method: XGBoosterGetModelRaw
|
||||||
* Signature: (J[[B)I
|
* Signature: (J[[B)I
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterGetModelRaw
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_XGBoosterGetModelRaw
|
||||||
(JNIEnv * jenv, jclass jcls, jlong jhandle, jobjectArray jout) {
|
(JNIEnv * jenv, jclass jcls, jlong jhandle, jobjectArray jout) {
|
||||||
BoosterHandle handle = (BoosterHandle) jhandle;
|
BoosterHandle handle = (BoosterHandle) jhandle;
|
||||||
bst_ulong len = 0;
|
bst_ulong len = 0;
|
||||||
@ -615,11 +615,11 @@ JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterGetModelRaw
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: XGBoosterDumpModel
|
* Method: XGBoosterDumpModel
|
||||||
* Signature: (JLjava/lang/String;I)[Ljava/lang/String;
|
* Signature: (JLjava/lang/String;I)[Ljava/lang/String;
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterDumpModel
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_XGBoosterDumpModel
|
||||||
(JNIEnv *jenv, jclass jcls, jlong jhandle, jstring jfmap, jint jwith_stats, jobjectArray jout) {
|
(JNIEnv *jenv, jclass jcls, jlong jhandle, jstring jfmap, jint jwith_stats, jobjectArray jout) {
|
||||||
BoosterHandle handle = (BoosterHandle) jhandle;
|
BoosterHandle handle = (BoosterHandle) jhandle;
|
||||||
const char *fmap = jenv->GetStringUTFChars(jfmap, 0);
|
const char *fmap = jenv->GetStringUTFChars(jfmap, 0);
|
||||||
@ -640,11 +640,11 @@ JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterDumpModel
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: XGBoosterLoadRabitCheckpoint
|
* Method: XGBoosterLoadRabitCheckpoint
|
||||||
* Signature: (J[I)I
|
* Signature: (J[I)I
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterLoadRabitCheckpoint
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_XGBoosterLoadRabitCheckpoint
|
||||||
(JNIEnv *jenv , jclass jcls, jlong jhandle, jintArray jout) {
|
(JNIEnv *jenv , jclass jcls, jlong jhandle, jintArray jout) {
|
||||||
BoosterHandle handle = (BoosterHandle) jhandle;
|
BoosterHandle handle = (BoosterHandle) jhandle;
|
||||||
int version;
|
int version;
|
||||||
@ -654,22 +654,22 @@ JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterLoadRabitCheck
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: XGBoosterSaveRabitCheckpoint
|
* Method: XGBoosterSaveRabitCheckpoint
|
||||||
* Signature: (J)I
|
* Signature: (J)I
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterSaveRabitCheckpoint
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_XGBoosterSaveRabitCheckpoint
|
||||||
(JNIEnv *jenv, jclass jcls, jlong jhandle) {
|
(JNIEnv *jenv, jclass jcls, jlong jhandle) {
|
||||||
BoosterHandle handle = (BoosterHandle) jhandle;
|
BoosterHandle handle = (BoosterHandle) jhandle;
|
||||||
return XGBoosterSaveRabitCheckpoint(handle);
|
return XGBoosterSaveRabitCheckpoint(handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: RabitInit
|
* Method: RabitInit
|
||||||
* Signature: ([Ljava/lang/String;)I
|
* Signature: ([Ljava/lang/String;)I
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_RabitInit
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_RabitInit
|
||||||
(JNIEnv *jenv, jclass jcls, jobjectArray jargs) {
|
(JNIEnv *jenv, jclass jcls, jobjectArray jargs) {
|
||||||
std::vector<std::string> args;
|
std::vector<std::string> args;
|
||||||
std::vector<char*> argv;
|
std::vector<char*> argv;
|
||||||
@ -691,22 +691,22 @@ JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_RabitInit
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: RabitFinalize
|
* Method: RabitFinalize
|
||||||
* Signature: ()I
|
* Signature: ()I
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_RabitFinalize
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_RabitFinalize
|
||||||
(JNIEnv *jenv, jclass jcls) {
|
(JNIEnv *jenv, jclass jcls) {
|
||||||
RabitFinalize();
|
RabitFinalize();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: RabitTrackerPrint
|
* Method: RabitTrackerPrint
|
||||||
* Signature: (Ljava/lang/String;)I
|
* Signature: (Ljava/lang/String;)I
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_RabitTrackerPrint
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_RabitTrackerPrint
|
||||||
(JNIEnv *jenv, jclass jcls, jstring jmsg) {
|
(JNIEnv *jenv, jclass jcls, jstring jmsg) {
|
||||||
std::string str(jenv->GetStringUTFChars(jmsg, 0),
|
std::string str(jenv->GetStringUTFChars(jmsg, 0),
|
||||||
jenv->GetStringLength(jmsg));
|
jenv->GetStringLength(jmsg));
|
||||||
@ -715,11 +715,11 @@ JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_RabitTrackerPrint
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: RabitGetRank
|
* Method: RabitGetRank
|
||||||
* Signature: ([I)I
|
* Signature: ([I)I
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_RabitGetRank
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_RabitGetRank
|
||||||
(JNIEnv *jenv, jclass jcls, jintArray jout) {
|
(JNIEnv *jenv, jclass jcls, jintArray jout) {
|
||||||
int rank = RabitGetRank();
|
int rank = RabitGetRank();
|
||||||
jenv->SetIntArrayRegion(jout, 0, 1, &rank);
|
jenv->SetIntArrayRegion(jout, 0, 1, &rank);
|
||||||
@ -727,11 +727,11 @@ JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_RabitGetRank
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: RabitGetWorldSize
|
* Method: RabitGetWorldSize
|
||||||
* Signature: ([I)I
|
* Signature: ([I)I
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_RabitGetWorldSize
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_RabitGetWorldSize
|
||||||
(JNIEnv *jenv, jclass jcls, jintArray jout) {
|
(JNIEnv *jenv, jclass jcls, jintArray jout) {
|
||||||
int out = RabitGetWorldSize();
|
int out = RabitGetWorldSize();
|
||||||
jenv->SetIntArrayRegion(jout, 0, 1, &out);
|
jenv->SetIntArrayRegion(jout, 0, 1, &out);
|
||||||
@ -739,11 +739,11 @@ JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_RabitGetWorldSize
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: RabitVersionNumber
|
* Method: RabitVersionNumber
|
||||||
* Signature: ([I)I
|
* Signature: ([I)I
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_RabitVersionNumber
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_RabitVersionNumber
|
||||||
(JNIEnv *jenv, jclass jcls, jintArray jout) {
|
(JNIEnv *jenv, jclass jcls, jintArray jout) {
|
||||||
int out = RabitVersionNumber();
|
int out = RabitVersionNumber();
|
||||||
jenv->SetIntArrayRegion(jout, 0, 1, &out);
|
jenv->SetIntArrayRegion(jout, 0, 1, &out);
|
||||||
|
|||||||
@ -1,306 +1,306 @@
|
|||||||
/* DO NOT EDIT THIS FILE - it is machine generated */
|
/* DO NOT EDIT THIS FILE - it is machine generated */
|
||||||
#include <jni.h>
|
#include <jni.h>
|
||||||
/* Header for class ml_dmlc_xgboost4j_XgboostJNI */
|
/* Header for class ml_dmlc_xgboost4j_java_XGBoostJNI */
|
||||||
|
|
||||||
#ifndef _Included_ml_dmlc_xgboost4j_XgboostJNI
|
#ifndef _Included_ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
#define _Included_ml_dmlc_xgboost4j_XgboostJNI
|
#define _Included_ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: XGBGetLastError
|
* Method: XGBGetLastError
|
||||||
* Signature: ()Ljava/lang/String;
|
* Signature: ()Ljava/lang/String;
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jstring JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBGetLastError
|
JNIEXPORT jstring JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_XGBGetLastError
|
||||||
(JNIEnv *, jclass);
|
(JNIEnv *, jclass);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: XGDMatrixCreateFromFile
|
* Method: XGDMatrixCreateFromFile
|
||||||
* Signature: (Ljava/lang/String;I[J)I
|
* Signature: (Ljava/lang/String;I[J)I
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixCreateFromFile
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_XGDMatrixCreateFromFile
|
||||||
(JNIEnv *, jclass, jstring, jint, jlongArray);
|
(JNIEnv *, jclass, jstring, jint, jlongArray);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: XGDMatrixCreateFromDataIter
|
* Method: XGDMatrixCreateFromDataIter
|
||||||
* Signature: (Ljava/util/Iterator;Ljava/lang/String;[J)I
|
* Signature: (Ljava/util/Iterator;Ljava/lang/String;[J)I
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixCreateFromDataIter
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_XGDMatrixCreateFromDataIter
|
||||||
(JNIEnv *, jclass, jobject, jstring, jlongArray);
|
(JNIEnv *, jclass, jobject, jstring, jlongArray);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: XGDMatrixCreateFromCSR
|
* Method: XGDMatrixCreateFromCSR
|
||||||
* Signature: ([J[I[F[J)I
|
* Signature: ([J[I[F[J)I
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixCreateFromCSR
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_XGDMatrixCreateFromCSR
|
||||||
(JNIEnv *, jclass, jlongArray, jintArray, jfloatArray, jlongArray);
|
(JNIEnv *, jclass, jlongArray, jintArray, jfloatArray, jlongArray);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: XGDMatrixCreateFromCSC
|
* Method: XGDMatrixCreateFromCSC
|
||||||
* Signature: ([J[I[F[J)I
|
* Signature: ([J[I[F[J)I
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixCreateFromCSC
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_XGDMatrixCreateFromCSC
|
||||||
(JNIEnv *, jclass, jlongArray, jintArray, jfloatArray, jlongArray);
|
(JNIEnv *, jclass, jlongArray, jintArray, jfloatArray, jlongArray);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: XGDMatrixCreateFromMat
|
* Method: XGDMatrixCreateFromMat
|
||||||
* Signature: ([FIIF[J)I
|
* Signature: ([FIIF[J)I
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixCreateFromMat
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_XGDMatrixCreateFromMat
|
||||||
(JNIEnv *, jclass, jfloatArray, jint, jint, jfloat, jlongArray);
|
(JNIEnv *, jclass, jfloatArray, jint, jint, jfloat, jlongArray);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: XGDMatrixSliceDMatrix
|
* Method: XGDMatrixSliceDMatrix
|
||||||
* Signature: (J[I[J)I
|
* Signature: (J[I[J)I
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixSliceDMatrix
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_XGDMatrixSliceDMatrix
|
||||||
(JNIEnv *, jclass, jlong, jintArray, jlongArray);
|
(JNIEnv *, jclass, jlong, jintArray, jlongArray);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: XGDMatrixFree
|
* Method: XGDMatrixFree
|
||||||
* Signature: (J)I
|
* Signature: (J)I
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixFree
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_XGDMatrixFree
|
||||||
(JNIEnv *, jclass, jlong);
|
(JNIEnv *, jclass, jlong);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: XGDMatrixSaveBinary
|
* Method: XGDMatrixSaveBinary
|
||||||
* Signature: (JLjava/lang/String;I)I
|
* Signature: (JLjava/lang/String;I)I
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixSaveBinary
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_XGDMatrixSaveBinary
|
||||||
(JNIEnv *, jclass, jlong, jstring, jint);
|
(JNIEnv *, jclass, jlong, jstring, jint);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: XGDMatrixSetFloatInfo
|
* Method: XGDMatrixSetFloatInfo
|
||||||
* Signature: (JLjava/lang/String;[F)I
|
* Signature: (JLjava/lang/String;[F)I
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixSetFloatInfo
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_XGDMatrixSetFloatInfo
|
||||||
(JNIEnv *, jclass, jlong, jstring, jfloatArray);
|
(JNIEnv *, jclass, jlong, jstring, jfloatArray);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: XGDMatrixSetUIntInfo
|
* Method: XGDMatrixSetUIntInfo
|
||||||
* Signature: (JLjava/lang/String;[I)I
|
* Signature: (JLjava/lang/String;[I)I
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixSetUIntInfo
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_XGDMatrixSetUIntInfo
|
||||||
(JNIEnv *, jclass, jlong, jstring, jintArray);
|
(JNIEnv *, jclass, jlong, jstring, jintArray);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: XGDMatrixSetGroup
|
* Method: XGDMatrixSetGroup
|
||||||
* Signature: (J[I)I
|
* Signature: (J[I)I
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixSetGroup
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_XGDMatrixSetGroup
|
||||||
(JNIEnv *, jclass, jlong, jintArray);
|
(JNIEnv *, jclass, jlong, jintArray);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: XGDMatrixGetFloatInfo
|
* Method: XGDMatrixGetFloatInfo
|
||||||
* Signature: (JLjava/lang/String;[[F)I
|
* Signature: (JLjava/lang/String;[[F)I
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixGetFloatInfo
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_XGDMatrixGetFloatInfo
|
||||||
(JNIEnv *, jclass, jlong, jstring, jobjectArray);
|
(JNIEnv *, jclass, jlong, jstring, jobjectArray);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: XGDMatrixGetUIntInfo
|
* Method: XGDMatrixGetUIntInfo
|
||||||
* Signature: (JLjava/lang/String;[[I)I
|
* Signature: (JLjava/lang/String;[[I)I
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixGetUIntInfo
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_XGDMatrixGetUIntInfo
|
||||||
(JNIEnv *, jclass, jlong, jstring, jobjectArray);
|
(JNIEnv *, jclass, jlong, jstring, jobjectArray);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: XGDMatrixNumRow
|
* Method: XGDMatrixNumRow
|
||||||
* Signature: (J[J)I
|
* Signature: (J[J)I
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixNumRow
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_XGDMatrixNumRow
|
||||||
(JNIEnv *, jclass, jlong, jlongArray);
|
(JNIEnv *, jclass, jlong, jlongArray);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: XGBoosterCreate
|
* Method: XGBoosterCreate
|
||||||
* Signature: ([J[J)I
|
* Signature: ([J[J)I
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterCreate
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_XGBoosterCreate
|
||||||
(JNIEnv *, jclass, jlongArray, jlongArray);
|
(JNIEnv *, jclass, jlongArray, jlongArray);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: XGBoosterFree
|
* Method: XGBoosterFree
|
||||||
* Signature: (J)I
|
* Signature: (J)I
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterFree
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_XGBoosterFree
|
||||||
(JNIEnv *, jclass, jlong);
|
(JNIEnv *, jclass, jlong);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: XGBoosterSetParam
|
* Method: XGBoosterSetParam
|
||||||
* Signature: (JLjava/lang/String;Ljava/lang/String;)I
|
* Signature: (JLjava/lang/String;Ljava/lang/String;)I
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterSetParam
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_XGBoosterSetParam
|
||||||
(JNIEnv *, jclass, jlong, jstring, jstring);
|
(JNIEnv *, jclass, jlong, jstring, jstring);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: XGBoosterUpdateOneIter
|
* Method: XGBoosterUpdateOneIter
|
||||||
* Signature: (JIJ)I
|
* Signature: (JIJ)I
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterUpdateOneIter
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_XGBoosterUpdateOneIter
|
||||||
(JNIEnv *, jclass, jlong, jint, jlong);
|
(JNIEnv *, jclass, jlong, jint, jlong);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: XGBoosterBoostOneIter
|
* Method: XGBoosterBoostOneIter
|
||||||
* Signature: (JJ[F[F)I
|
* Signature: (JJ[F[F)I
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterBoostOneIter
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_XGBoosterBoostOneIter
|
||||||
(JNIEnv *, jclass, jlong, jlong, jfloatArray, jfloatArray);
|
(JNIEnv *, jclass, jlong, jlong, jfloatArray, jfloatArray);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: XGBoosterEvalOneIter
|
* Method: XGBoosterEvalOneIter
|
||||||
* Signature: (JI[J[Ljava/lang/String;[Ljava/lang/String;)I
|
* Signature: (JI[J[Ljava/lang/String;[Ljava/lang/String;)I
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterEvalOneIter
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_XGBoosterEvalOneIter
|
||||||
(JNIEnv *, jclass, jlong, jint, jlongArray, jobjectArray, jobjectArray);
|
(JNIEnv *, jclass, jlong, jint, jlongArray, jobjectArray, jobjectArray);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: XGBoosterPredict
|
* Method: XGBoosterPredict
|
||||||
* Signature: (JJII[[F)I
|
* Signature: (JJII[[F)I
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterPredict
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_XGBoosterPredict
|
||||||
(JNIEnv *, jclass, jlong, jlong, jint, jint, jobjectArray);
|
(JNIEnv *, jclass, jlong, jlong, jint, jint, jobjectArray);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: XGBoosterLoadModel
|
* Method: XGBoosterLoadModel
|
||||||
* Signature: (JLjava/lang/String;)I
|
* Signature: (JLjava/lang/String;)I
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterLoadModel
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_XGBoosterLoadModel
|
||||||
(JNIEnv *, jclass, jlong, jstring);
|
(JNIEnv *, jclass, jlong, jstring);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: XGBoosterSaveModel
|
* Method: XGBoosterSaveModel
|
||||||
* Signature: (JLjava/lang/String;)I
|
* Signature: (JLjava/lang/String;)I
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterSaveModel
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_XGBoosterSaveModel
|
||||||
(JNIEnv *, jclass, jlong, jstring);
|
(JNIEnv *, jclass, jlong, jstring);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: XGBoosterLoadModelFromBuffer
|
* Method: XGBoosterLoadModelFromBuffer
|
||||||
* Signature: (J[B)I
|
* Signature: (J[B)I
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterLoadModelFromBuffer
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_XGBoosterLoadModelFromBuffer
|
||||||
(JNIEnv *, jclass, jlong, jbyteArray);
|
(JNIEnv *, jclass, jlong, jbyteArray);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: XGBoosterGetModelRaw
|
* Method: XGBoosterGetModelRaw
|
||||||
* Signature: (J[[B)I
|
* Signature: (J[[B)I
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterGetModelRaw
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_XGBoosterGetModelRaw
|
||||||
(JNIEnv *, jclass, jlong, jobjectArray);
|
(JNIEnv *, jclass, jlong, jobjectArray);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: XGBoosterDumpModel
|
* Method: XGBoosterDumpModel
|
||||||
* Signature: (JLjava/lang/String;I[[Ljava/lang/String;)I
|
* Signature: (JLjava/lang/String;I[[Ljava/lang/String;)I
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterDumpModel
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_XGBoosterDumpModel
|
||||||
(JNIEnv *, jclass, jlong, jstring, jint, jobjectArray);
|
(JNIEnv *, jclass, jlong, jstring, jint, jobjectArray);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: XGBoosterGetAttr
|
* Method: XGBoosterGetAttr
|
||||||
* Signature: (JLjava/lang/String;[Ljava/lang/String;)I
|
* Signature: (JLjava/lang/String;[Ljava/lang/String;)I
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterGetAttr
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_XGBoosterGetAttr
|
||||||
(JNIEnv *, jclass, jlong, jstring, jobjectArray);
|
(JNIEnv *, jclass, jlong, jstring, jobjectArray);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: XGBoosterSetAttr
|
* Method: XGBoosterSetAttr
|
||||||
* Signature: (JLjava/lang/String;Ljava/lang/String;)I
|
* Signature: (JLjava/lang/String;Ljava/lang/String;)I
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterSetAttr
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_XGBoosterSetAttr
|
||||||
(JNIEnv *, jclass, jlong, jstring, jstring);
|
(JNIEnv *, jclass, jlong, jstring, jstring);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: XGBoosterLoadRabitCheckpoint
|
* Method: XGBoosterLoadRabitCheckpoint
|
||||||
* Signature: (J[I)I
|
* Signature: (J[I)I
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterLoadRabitCheckpoint
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_XGBoosterLoadRabitCheckpoint
|
||||||
(JNIEnv *, jclass, jlong, jintArray);
|
(JNIEnv *, jclass, jlong, jintArray);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: XGBoosterSaveRabitCheckpoint
|
* Method: XGBoosterSaveRabitCheckpoint
|
||||||
* Signature: (J)I
|
* Signature: (J)I
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterSaveRabitCheckpoint
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_XGBoosterSaveRabitCheckpoint
|
||||||
(JNIEnv *, jclass, jlong);
|
(JNIEnv *, jclass, jlong);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: RabitInit
|
* Method: RabitInit
|
||||||
* Signature: ([Ljava/lang/String;)I
|
* Signature: ([Ljava/lang/String;)I
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_RabitInit
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_RabitInit
|
||||||
(JNIEnv *, jclass, jobjectArray);
|
(JNIEnv *, jclass, jobjectArray);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: RabitFinalize
|
* Method: RabitFinalize
|
||||||
* Signature: ()I
|
* Signature: ()I
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_RabitFinalize
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_RabitFinalize
|
||||||
(JNIEnv *, jclass);
|
(JNIEnv *, jclass);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: RabitTrackerPrint
|
* Method: RabitTrackerPrint
|
||||||
* Signature: (Ljava/lang/String;)I
|
* Signature: (Ljava/lang/String;)I
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_RabitTrackerPrint
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_RabitTrackerPrint
|
||||||
(JNIEnv *, jclass, jstring);
|
(JNIEnv *, jclass, jstring);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: RabitGetRank
|
* Method: RabitGetRank
|
||||||
* Signature: ([I)I
|
* Signature: ([I)I
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_RabitGetRank
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_RabitGetRank
|
||||||
(JNIEnv *, jclass, jintArray);
|
(JNIEnv *, jclass, jintArray);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: RabitGetWorldSize
|
* Method: RabitGetWorldSize
|
||||||
* Signature: ([I)I
|
* Signature: ([I)I
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_RabitGetWorldSize
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_RabitGetWorldSize
|
||||||
(JNIEnv *, jclass, jintArray);
|
(JNIEnv *, jclass, jintArray);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
* Class: ml_dmlc_xgboost4j_java_XGBoostJNI
|
||||||
* Method: RabitVersionNumber
|
* Method: RabitVersionNumber
|
||||||
* Signature: ([I)I
|
* Signature: ([I)I
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_RabitVersionNumber
|
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_java_XGBoostJNI_RabitVersionNumber
|
||||||
(JNIEnv *, jclass, jintArray);
|
(JNIEnv *, jclass, jintArray);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|||||||
@ -21,6 +21,7 @@ import java.util.Arrays
|
|||||||
import scala.util.Random
|
import scala.util.Random
|
||||||
|
|
||||||
import org.scalatest.FunSuite
|
import org.scalatest.FunSuite
|
||||||
|
import ml.dmlc.xgboost4j.java.{DMatrix => JDMatrix}
|
||||||
|
|
||||||
class DMatrixSuite extends FunSuite {
|
class DMatrixSuite extends FunSuite {
|
||||||
test("create DMatrix from File") {
|
test("create DMatrix from File") {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user