rename files/packages
This commit is contained in:
parent
55e36893cd
commit
f8fff6c6fc
2
Makefile
2
Makefile
@ -84,7 +84,7 @@ $(DMLC_CORE)/libdmlc.a:
|
||||
$(RABIT)/lib/$(LIB_RABIT):
|
||||
+ cd $(RABIT); make lib/$(LIB_RABIT); cd $(ROOTDIR)
|
||||
|
||||
jvm-packages: jvm-packages/lib/libxgboost4j.so
|
||||
jvm: jvm-packages/lib/libxgboost4j.so
|
||||
|
||||
SRC = $(wildcard src/*.cc src/*/*.cc)
|
||||
ALL_OBJ = $(patsubst src/%.cc, build/%.o, $(SRC)) $(PLUGIN_OBJS)
|
||||
|
||||
@ -29,5 +29,5 @@
|
||||
|
||||
<suppressions>
|
||||
<suppress checks=".*"
|
||||
files="xgboost4j/src/main/java/org/dmlc/xgboost4j/XgboostJNI.java"/>
|
||||
files="xgboost4j/src/main/java/ml/dmlc/xgboost4j/XgboostJNI.java"/>
|
||||
</suppressions>
|
||||
|
||||
@ -16,7 +16,7 @@ if [ $(uname) == "Darwin" ]; then
|
||||
fi
|
||||
|
||||
cd ..
|
||||
make jvm-packages no_omp=${dis_omp}
|
||||
make jvm no_omp=${dis_omp}
|
||||
cd jvm-packages
|
||||
echo "move native lib"
|
||||
|
||||
@ -13,17 +13,19 @@
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
package org.dmlc.xgboost4j.demo;
|
||||
|
||||
import org.dmlc.xgboost4j.*;
|
||||
import org.dmlc.xgboost4j.demo.util.DataLoader;
|
||||
package ml.dmlc.xgboost4j.demo;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
|
||||
import ml.dmlc.xgboost4j.Booster;
|
||||
import ml.dmlc.xgboost4j.DMatrix;
|
||||
import ml.dmlc.xgboost4j.XGBoost;
|
||||
import ml.dmlc.xgboost4j.XGBoostError;
|
||||
import ml.dmlc.xgboost4j.demo.util.DataLoader;
|
||||
|
||||
/**
|
||||
* a simple example of java wrapper for xgboost
|
||||
*
|
||||
@ -13,12 +13,15 @@
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
package org.dmlc.xgboost4j.demo;
|
||||
|
||||
import org.dmlc.xgboost4j.*;
|
||||
package ml.dmlc.xgboost4j.demo;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import ml.dmlc.xgboost4j.Booster;
|
||||
import ml.dmlc.xgboost4j.DMatrix;
|
||||
import ml.dmlc.xgboost4j.XGBoost;
|
||||
import ml.dmlc.xgboost4j.XGBoostError;
|
||||
|
||||
/**
|
||||
* example for start from a initial base prediction
|
||||
*
|
||||
@ -13,15 +13,15 @@
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
package org.dmlc.xgboost4j.demo;
|
||||
|
||||
import org.dmlc.xgboost4j.DMatrix;
|
||||
import org.dmlc.xgboost4j.XGBoost;
|
||||
import org.dmlc.xgboost4j.XGBoostError;
|
||||
package ml.dmlc.xgboost4j.demo;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
|
||||
import ml.dmlc.xgboost4j.DMatrix;
|
||||
import ml.dmlc.xgboost4j.XGBoost;
|
||||
import ml.dmlc.xgboost4j.XGBoostError;
|
||||
|
||||
/**
|
||||
* an example of cross validation
|
||||
*
|
||||
@ -13,16 +13,16 @@
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
package org.dmlc.xgboost4j.demo;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.dmlc.xgboost4j.*;
|
||||
package ml.dmlc.xgboost4j.demo;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import ml.dmlc.xgboost4j.*;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
/**
|
||||
* an example user define objective and eval
|
||||
* NOTE: when you do customized loss function, the default prediction value is margin
|
||||
@ -64,7 +64,7 @@ public class CustomObjective {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<float[]> getGradient(float[][] predicts, org.dmlc.xgboost4j.DMatrix dtrain) {
|
||||
public List<float[]> getGradient(float[][] predicts, DMatrix dtrain) {
|
||||
int nrow = predicts.length;
|
||||
List<float[]> gradients = new ArrayList<float[]>();
|
||||
float[] labels;
|
||||
@ -114,7 +114,7 @@ public class CustomObjective {
|
||||
}
|
||||
|
||||
@Override
|
||||
public float eval(float[][] predicts, org.dmlc.xgboost4j.DMatrix dmat) {
|
||||
public float eval(float[][] predicts, DMatrix dmat) {
|
||||
float error = 0f;
|
||||
float[] labels;
|
||||
try {
|
||||
@ -138,11 +138,9 @@ public class CustomObjective {
|
||||
|
||||
public static void main(String[] args) throws XGBoostError {
|
||||
//load train mat (svmlight format)
|
||||
org.dmlc.xgboost4j.DMatrix trainMat =
|
||||
new org.dmlc.xgboost4j.DMatrix("../../demo/data/agaricus.txt.train");
|
||||
DMatrix trainMat = new DMatrix("../../demo/data/agaricus.txt.train");
|
||||
//load valid mat (svmlight format)
|
||||
org.dmlc.xgboost4j.DMatrix testMat =
|
||||
new org.dmlc.xgboost4j.DMatrix("../../demo/data/agaricus.txt.test");
|
||||
DMatrix testMat = new DMatrix("../../demo/data/agaricus.txt.test");
|
||||
|
||||
HashMap<String, Object> params = new HashMap<String, Object>();
|
||||
params.put("eta", 1.0);
|
||||
@ -154,8 +152,7 @@ public class CustomObjective {
|
||||
int round = 2;
|
||||
|
||||
//specify watchList
|
||||
HashMap<String, org.dmlc.xgboost4j.DMatrix> watches =
|
||||
new HashMap<String, org.dmlc.xgboost4j.DMatrix>();
|
||||
HashMap<String, DMatrix> watches = new HashMap<String, DMatrix>();
|
||||
watches.put("train", trainMat);
|
||||
watches.put("test", testMat);
|
||||
|
||||
@ -13,12 +13,15 @@
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
package org.dmlc.xgboost4j.demo;
|
||||
|
||||
import org.dmlc.xgboost4j.*;
|
||||
package ml.dmlc.xgboost4j.demo;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import ml.dmlc.xgboost4j.Booster;
|
||||
import ml.dmlc.xgboost4j.DMatrix;
|
||||
import ml.dmlc.xgboost4j.XGBoost;
|
||||
import ml.dmlc.xgboost4j.XGBoostError;
|
||||
|
||||
/**
|
||||
* simple example for using external memory version
|
||||
*
|
||||
@ -13,10 +13,13 @@
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
package org.dmlc.xgboost4j.demo;
|
||||
package ml.dmlc.xgboost4j.demo;
|
||||
|
||||
import org.dmlc.xgboost4j.*;
|
||||
import org.dmlc.xgboost4j.demo.util.CustomEval;
|
||||
import ml.dmlc.xgboost4j.Booster;
|
||||
import ml.dmlc.xgboost4j.DMatrix;
|
||||
import ml.dmlc.xgboost4j.XGBoost;
|
||||
import ml.dmlc.xgboost4j.XGBoostError;
|
||||
import ml.dmlc.xgboost4j.demo.util.CustomEval;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
@ -13,13 +13,16 @@
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
package org.dmlc.xgboost4j.demo;
|
||||
|
||||
import org.dmlc.xgboost4j.*;
|
||||
import org.dmlc.xgboost4j.demo.util.CustomEval;
|
||||
package ml.dmlc.xgboost4j.demo;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import ml.dmlc.xgboost4j.Booster;
|
||||
import ml.dmlc.xgboost4j.DMatrix;
|
||||
import ml.dmlc.xgboost4j.XGBoost;
|
||||
import ml.dmlc.xgboost4j.XGBoostError;
|
||||
import ml.dmlc.xgboost4j.demo.util.CustomEval;
|
||||
|
||||
/**
|
||||
* predict first ntree
|
||||
*
|
||||
@ -13,13 +13,16 @@
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
package org.dmlc.xgboost4j.demo;
|
||||
|
||||
import org.dmlc.xgboost4j.*;
|
||||
package ml.dmlc.xgboost4j.demo;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
|
||||
import ml.dmlc.xgboost4j.Booster;
|
||||
import ml.dmlc.xgboost4j.DMatrix;
|
||||
import ml.dmlc.xgboost4j.XGBoost;
|
||||
import ml.dmlc.xgboost4j.XGBoostError;
|
||||
|
||||
/**
|
||||
* predict leaf indices
|
||||
*
|
||||
@ -13,13 +13,13 @@
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
package org.dmlc.xgboost4j.demo.util;
|
||||
package ml.dmlc.xgboost4j.demo.util;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.dmlc.xgboost4j.DMatrix;
|
||||
import org.dmlc.xgboost4j.IEvaluation;
|
||||
import org.dmlc.xgboost4j.XGBoostError;
|
||||
import ml.dmlc.xgboost4j.DMatrix;
|
||||
import ml.dmlc.xgboost4j.IEvaluation;
|
||||
import ml.dmlc.xgboost4j.XGBoostError;
|
||||
|
||||
/**
|
||||
* a util evaluation class for examples
|
||||
@ -13,7 +13,7 @@
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
package org.dmlc.xgboost4j.demo.util;
|
||||
package ml.dmlc.xgboost4j.demo.util;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
package org.dmlc.xgboost4j;
|
||||
package ml.dmlc.xgboost4j;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
@ -13,7 +13,7 @@
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
package org.dmlc.xgboost4j;
|
||||
package ml.dmlc.xgboost4j;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
@ -13,7 +13,7 @@
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
package org.dmlc.xgboost4j;
|
||||
package ml.dmlc.xgboost4j;
|
||||
|
||||
/**
|
||||
* interface for customized evaluation
|
||||
@ -13,7 +13,7 @@
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
package org.dmlc.xgboost4j;
|
||||
package ml.dmlc.xgboost4j;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
package org.dmlc.xgboost4j;
|
||||
package ml.dmlc.xgboost4j;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
@ -13,7 +13,7 @@
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
package org.dmlc.xgboost4j;
|
||||
package ml.dmlc.xgboost4j;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
@ -13,7 +13,7 @@
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
package org.dmlc.xgboost4j;
|
||||
package ml.dmlc.xgboost4j;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
@ -13,7 +13,7 @@
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
package org.dmlc.xgboost4j;
|
||||
package ml.dmlc.xgboost4j;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
@ -13,7 +13,7 @@
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
package org.dmlc.xgboost4j;
|
||||
package ml.dmlc.xgboost4j;
|
||||
|
||||
/**
|
||||
* custom error class for xgboost
|
||||
@ -13,7 +13,7 @@
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
package org.dmlc.xgboost4j;
|
||||
package ml.dmlc.xgboost4j;
|
||||
|
||||
/**
|
||||
* xgboost jni wrapper functions for xgboost_wrapper.h
|
||||
@ -14,13 +14,14 @@
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dmlc.xgboost4j.scala
|
||||
package ml.dmlc.xgboost4j.scala
|
||||
|
||||
import java.io.IOException
|
||||
|
||||
import scala.collection.mutable
|
||||
|
||||
import org.dmlc.xgboost4j.{IEvaluation, IObjective, XGBoostError}
|
||||
import ml.dmlc.xgboost4j.XGBoostError
|
||||
|
||||
|
||||
trait Booster {
|
||||
|
||||
@ -58,7 +59,7 @@ trait Booster {
|
||||
* @param obj customized objective class
|
||||
*/
|
||||
@throws(classOf[XGBoostError])
|
||||
def update(dtrain: DMatrix, obj: IObjective)
|
||||
def update(dtrain: DMatrix, obj: ObjectiveTrait)
|
||||
|
||||
/**
|
||||
* update with give grad and hess
|
||||
@ -90,7 +91,7 @@ trait Booster {
|
||||
* @return eval information
|
||||
*/
|
||||
@throws(classOf[XGBoostError])
|
||||
def evalSet(evalMatrixs: Array[DMatrix], evalNames: Array[String], eval: IEvaluation): String
|
||||
def evalSet(evalMatrixs: Array[DMatrix], evalNames: Array[String], eval: EvalTrait): String
|
||||
|
||||
/**
|
||||
* Predict with data
|
||||
@ -14,9 +14,9 @@
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dmlc.xgboost4j.scala
|
||||
package ml.dmlc.xgboost4j.scala
|
||||
|
||||
import org.dmlc.xgboost4j.{DMatrix => JDMatrix, XGBoostError}
|
||||
import ml.dmlc.xgboost4j.{DMatrix => JDMatrix, XGBoostError}
|
||||
|
||||
class DMatrix private(private[scala] val jDMatrix: JDMatrix) {
|
||||
|
||||
@ -14,9 +14,9 @@
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dmlc.xgboost4j.scala
|
||||
package ml.dmlc.xgboost4j.scala
|
||||
|
||||
import org.dmlc.xgboost4j.IEvaluation
|
||||
import ml.dmlc.xgboost4j.IEvaluation
|
||||
|
||||
trait EvalTrait extends IEvaluation {
|
||||
|
||||
@ -14,9 +14,9 @@
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dmlc.xgboost4j.scala
|
||||
package ml.dmlc.xgboost4j.scala
|
||||
|
||||
import org.dmlc.xgboost4j.IObjective
|
||||
import ml.dmlc.xgboost4j.IObjective
|
||||
|
||||
trait ObjectiveTrait extends IObjective {
|
||||
/**
|
||||
@ -14,12 +14,12 @@
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dmlc.xgboost4j.scala
|
||||
package ml.dmlc.xgboost4j.scala
|
||||
|
||||
import scala.collection.JavaConverters._
|
||||
import scala.collection.mutable
|
||||
|
||||
import org.dmlc.xgboost4j.{Booster => JBooster, IEvaluation, IObjective}
|
||||
import ml.dmlc.xgboost4j.{Booster => JBooster, IEvaluation, IObjective}
|
||||
|
||||
private[scala] class ScalaBoosterImpl private[xgboost4j](booster: JBooster) extends Booster {
|
||||
|
||||
@ -31,7 +31,7 @@ private[scala] class ScalaBoosterImpl private[xgboost4j](booster: JBooster) exte
|
||||
booster.update(dtrain.jDMatrix, iter)
|
||||
}
|
||||
|
||||
override def update(dtrain: DMatrix, obj: IObjective): Unit = {
|
||||
override def update(dtrain: DMatrix, obj: ObjectiveTrait): Unit = {
|
||||
booster.update(dtrain.jDMatrix, obj)
|
||||
}
|
||||
|
||||
@ -51,7 +51,7 @@ private[scala] class ScalaBoosterImpl private[xgboost4j](booster: JBooster) exte
|
||||
booster.evalSet(evalMatrixs.map(_.jDMatrix), evalNames, iter)
|
||||
}
|
||||
|
||||
override def evalSet(evalMatrixs: Array[DMatrix], evalNames: Array[String], eval: IEvaluation):
|
||||
override def evalSet(evalMatrixs: Array[DMatrix], evalNames: Array[String], eval: EvalTrait):
|
||||
String = {
|
||||
booster.evalSet(evalMatrixs.map(_.jDMatrix), evalNames, eval)
|
||||
}
|
||||
@ -14,15 +14,15 @@
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dmlc.xgboost4j.scala
|
||||
package ml.dmlc.xgboost4j.scala
|
||||
|
||||
import _root_.scala.collection.JavaConverters._
|
||||
import org.dmlc.xgboost4j.{IEvaluation, IObjective, XGBoost => JXGBoost}
|
||||
import ml.dmlc.xgboost4j.{XGBoost => JXGBoost}
|
||||
|
||||
object XGBoost {
|
||||
|
||||
def train(params: Map[String, AnyRef], dtrain: DMatrix, round: Int,
|
||||
watches: Map[String, DMatrix], obj: IObjective, eval: IEvaluation): Booster = {
|
||||
watches: Map[String, DMatrix], obj: ObjectiveTrait, eval: EvalTrait): Booster = {
|
||||
val jWatches = watches.map{case (name, matrix) => (name, matrix.jDMatrix)}
|
||||
val xgboostInJava = JXGBoost.train(params.asJava, dtrain.jDMatrix, round, jWatches.asJava,
|
||||
obj, eval)
|
||||
@ -35,10 +35,9 @@ object XGBoost {
|
||||
round: Int,
|
||||
nfold: Int,
|
||||
metrics: Array[String],
|
||||
obj: EvalTrait,
|
||||
eval: ObjectiveTrait): Array[String] = {
|
||||
JXGBoost.crossValiation(params.asJava, data.jDMatrix, round, nfold, metrics,
|
||||
obj.asInstanceOf[IObjective], eval.asInstanceOf[IEvaluation])
|
||||
obj: ObjectiveTrait,
|
||||
eval: EvalTrait): Array[String] = {
|
||||
JXGBoost.crossValiation(params.asJava, data.jDMatrix, round, nfold, metrics, obj, eval)
|
||||
}
|
||||
|
||||
def initBoostModel(params: Map[String, AnyRef], dMatrixs: Array[DMatrix]): Booster = {
|
||||
@ -24,7 +24,7 @@ void setHandle(JNIEnv *jenv, jlongArray jhandle, void* handle) {
|
||||
jenv->SetLongArrayRegion(jhandle, 0, 1, (const jlong*) out);
|
||||
}
|
||||
|
||||
JNIEXPORT jstring JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGBGetLastError
|
||||
JNIEXPORT jstring JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBGetLastError
|
||||
(JNIEnv *jenv, jclass jcls) {
|
||||
jstring jresult = 0 ;
|
||||
const char* result = XGBGetLastError();
|
||||
@ -32,7 +32,7 @@ JNIEXPORT jstring JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGBGetLastError
|
||||
return jresult;
|
||||
}
|
||||
|
||||
JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGDMatrixCreateFromFile
|
||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixCreateFromFile
|
||||
(JNIEnv *jenv, jclass jcls, jstring jfname, jint jsilent, jlongArray jout) {
|
||||
DMatrixHandle result;
|
||||
const char* fname = jenv->GetStringUTFChars(jfname, 0);
|
||||
@ -43,11 +43,11 @@ JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGDMatrixCreateFromFil
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: org_dmlc_xgboost4j_XgboostJNI
|
||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
||||
* Method: XGDMatrixCreateFromCSR
|
||||
* Signature: ([J[J[F)J
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGDMatrixCreateFromCSR
|
||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixCreateFromCSR
|
||||
(JNIEnv *jenv, jclass jcls, jlongArray jindptr, jintArray jindices, jfloatArray jdata, jlongArray jout) {
|
||||
DMatrixHandle result;
|
||||
jlong* indptr = jenv->GetLongArrayElements(jindptr, 0);
|
||||
@ -65,11 +65,11 @@ JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGDMatrixCreateFromCSR
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: org_dmlc_xgboost4j_XgboostJNI
|
||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
||||
* Method: XGDMatrixCreateFromCSC
|
||||
* Signature: ([J[J[F)J
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGDMatrixCreateFromCSC
|
||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixCreateFromCSC
|
||||
(JNIEnv *jenv, jclass jcls, jlongArray jindptr, jintArray jindices, jfloatArray jdata, jlongArray jout) {
|
||||
DMatrixHandle result;
|
||||
jlong* indptr = jenv->GetLongArrayElements(jindptr, NULL);
|
||||
@ -89,11 +89,11 @@ JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGDMatrixCreateFromCSC
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: org_dmlc_xgboost4j_XgboostJNI
|
||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
||||
* Method: XGDMatrixCreateFromMat
|
||||
* Signature: ([FIIF)J
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGDMatrixCreateFromMat
|
||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixCreateFromMat
|
||||
(JNIEnv *jenv, jclass jcls, jfloatArray jdata, jint jnrow, jint jncol, jfloat jmiss, jlongArray jout) {
|
||||
DMatrixHandle result;
|
||||
jfloat* data = jenv->GetFloatArrayElements(jdata, 0);
|
||||
@ -107,11 +107,11 @@ JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGDMatrixCreateFromMat
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: org_dmlc_xgboost4j_XgboostJNI
|
||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
||||
* Method: XGDMatrixSliceDMatrix
|
||||
* Signature: (J[I)J
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGDMatrixSliceDMatrix
|
||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixSliceDMatrix
|
||||
(JNIEnv *jenv, jclass jcls, jlong jhandle, jintArray jindexset, jlongArray jout) {
|
||||
DMatrixHandle result;
|
||||
DMatrixHandle handle = (DMatrixHandle) jhandle;
|
||||
@ -128,11 +128,11 @@ JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGDMatrixSliceDMatrix
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: org_dmlc_xgboost4j_XgboostJNI
|
||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
||||
* Method: XGDMatrixFree
|
||||
* Signature: (J)V
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGDMatrixFree
|
||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixFree
|
||||
(JNIEnv *jenv, jclass jcls, jlong jhandle) {
|
||||
DMatrixHandle handle = (DMatrixHandle) jhandle;
|
||||
int ret = XGDMatrixFree(handle);
|
||||
@ -140,11 +140,11 @@ JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGDMatrixFree
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: org_dmlc_xgboost4j_XgboostJNI
|
||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
||||
* Method: XGDMatrixSaveBinary
|
||||
* Signature: (JLjava/lang/String;I)V
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGDMatrixSaveBinary
|
||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixSaveBinary
|
||||
(JNIEnv *jenv, jclass jcls, jlong jhandle, jstring jfname, jint jsilent) {
|
||||
DMatrixHandle handle = (DMatrixHandle) jhandle;
|
||||
const char* fname = jenv->GetStringUTFChars(jfname, 0);
|
||||
@ -154,11 +154,11 @@ JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGDMatrixSaveBinary
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: org_dmlc_xgboost4j_XgboostJNI
|
||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
||||
* Method: XGDMatrixSetFloatInfo
|
||||
* Signature: (JLjava/lang/String;[F)V
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGDMatrixSetFloatInfo
|
||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixSetFloatInfo
|
||||
(JNIEnv *jenv, jclass jcls, jlong jhandle, jstring jfield, jfloatArray jarray) {
|
||||
DMatrixHandle handle = (DMatrixHandle) jhandle;
|
||||
const char* field = jenv->GetStringUTFChars(jfield, 0);
|
||||
@ -173,11 +173,11 @@ JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGDMatrixSetFloatInfo
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: org_dmlc_xgboost4j_XgboostJNI
|
||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
||||
* Method: XGDMatrixSetUIntInfo
|
||||
* Signature: (JLjava/lang/String;[I)V
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGDMatrixSetUIntInfo
|
||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixSetUIntInfo
|
||||
(JNIEnv *jenv, jclass jcls, jlong jhandle, jstring jfield, jintArray jarray) {
|
||||
DMatrixHandle handle = (DMatrixHandle) jhandle;
|
||||
const char* field = jenv->GetStringUTFChars(jfield, 0);
|
||||
@ -192,11 +192,11 @@ JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGDMatrixSetUIntInfo
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: org_dmlc_xgboost4j_XgboostJNI
|
||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
||||
* Method: XGDMatrixSetGroup
|
||||
* Signature: (J[I)V
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGDMatrixSetGroup
|
||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixSetGroup
|
||||
(JNIEnv * jenv, jclass jcls, jlong jhandle, jintArray jarray) {
|
||||
DMatrixHandle handle = (DMatrixHandle) jhandle;
|
||||
jint* array = jenv->GetIntArrayElements(jarray, NULL);
|
||||
@ -208,11 +208,11 @@ JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGDMatrixSetGroup
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: org_dmlc_xgboost4j_XgboostJNI
|
||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
||||
* Method: XGDMatrixGetFloatInfo
|
||||
* Signature: (JLjava/lang/String;)[F
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGDMatrixGetFloatInfo
|
||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixGetFloatInfo
|
||||
(JNIEnv *jenv, jclass jcls, jlong jhandle, jstring jfield, jobjectArray jout) {
|
||||
DMatrixHandle handle = (DMatrixHandle) jhandle;
|
||||
const char* field = jenv->GetStringUTFChars(jfield, 0);
|
||||
@ -230,11 +230,11 @@ JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGDMatrixGetFloatInfo
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: org_dmlc_xgboost4j_XgboostJNI
|
||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
||||
* Method: XGDMatrixGetUIntInfo
|
||||
* Signature: (JLjava/lang/String;)[I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGDMatrixGetUIntInfo
|
||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixGetUIntInfo
|
||||
(JNIEnv *jenv, jclass jcls, jlong jhandle, jstring jfield, jobjectArray jout) {
|
||||
DMatrixHandle handle = (DMatrixHandle) jhandle;
|
||||
const char* field = jenv->GetStringUTFChars(jfield, 0);
|
||||
@ -251,11 +251,11 @@ JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGDMatrixGetUIntInfo
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: org_dmlc_xgboost4j_XgboostJNI
|
||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
||||
* Method: XGDMatrixNumRow
|
||||
* Signature: (J)J
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGDMatrixNumRow
|
||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixNumRow
|
||||
(JNIEnv *jenv, jclass jcls, jlong jhandle, jlongArray jout) {
|
||||
DMatrixHandle handle = (DMatrixHandle) jhandle;
|
||||
bst_ulong result[1];
|
||||
@ -265,11 +265,11 @@ JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGDMatrixNumRow
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: org_dmlc_xgboost4j_XgboostJNI
|
||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
||||
* Method: XGBoosterCreate
|
||||
* Signature: ([J)J
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGBoosterCreate
|
||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterCreate
|
||||
(JNIEnv *jenv, jclass jcls, jlongArray jhandles, jlongArray jout) {
|
||||
DMatrixHandle* handles;
|
||||
bst_ulong len = 0;
|
||||
@ -298,11 +298,11 @@ JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGBoosterCreate
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: org_dmlc_xgboost4j_XgboostJNI
|
||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
||||
* Method: XGBoosterFree
|
||||
* Signature: (J)V
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGBoosterFree
|
||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterFree
|
||||
(JNIEnv *jenv, jclass jcls, jlong jhandle) {
|
||||
BoosterHandle handle = (BoosterHandle) jhandle;
|
||||
return XGBoosterFree(handle);
|
||||
@ -310,11 +310,11 @@ JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGBoosterFree
|
||||
|
||||
|
||||
/*
|
||||
* Class: org_dmlc_xgboost4j_XgboostJNI
|
||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
||||
* Method: XGBoosterSetParam
|
||||
* Signature: (JLjava/lang/String;Ljava/lang/String;)V
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGBoosterSetParam
|
||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterSetParam
|
||||
(JNIEnv *jenv, jclass jcls, jlong jhandle, jstring jname, jstring jvalue) {
|
||||
BoosterHandle handle = (BoosterHandle) jhandle;
|
||||
const char* name = jenv->GetStringUTFChars(jname, 0);
|
||||
@ -327,11 +327,11 @@ JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGBoosterSetParam
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: org_dmlc_xgboost4j_XgboostJNI
|
||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
||||
* Method: XGBoosterUpdateOneIter
|
||||
* Signature: (JIJ)V
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGBoosterUpdateOneIter
|
||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterUpdateOneIter
|
||||
(JNIEnv *jenv, jclass jcls, jlong jhandle, jint jiter, jlong jdtrain) {
|
||||
BoosterHandle handle = (BoosterHandle) jhandle;
|
||||
DMatrixHandle dtrain = (DMatrixHandle) jdtrain;
|
||||
@ -339,11 +339,11 @@ JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGBoosterUpdateOneIter
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: org_dmlc_xgboost4j_XgboostJNI
|
||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
||||
* Method: XGBoosterBoostOneIter
|
||||
* Signature: (JJ[F[F)V
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGBoosterBoostOneIter
|
||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterBoostOneIter
|
||||
(JNIEnv *jenv, jclass jcls, jlong jhandle, jlong jdtrain, jfloatArray jgrad, jfloatArray jhess) {
|
||||
BoosterHandle handle = (BoosterHandle) jhandle;
|
||||
DMatrixHandle dtrain = (DMatrixHandle) jdtrain;
|
||||
@ -358,11 +358,11 @@ JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGBoosterBoostOneIter
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: org_dmlc_xgboost4j_XgboostJNI
|
||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
||||
* Method: XGBoosterEvalOneIter
|
||||
* Signature: (JI[J[Ljava/lang/String;)Ljava/lang/String;
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGBoosterEvalOneIter
|
||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterEvalOneIter
|
||||
(JNIEnv *jenv, jclass jcls, jlong jhandle, jint jiter, jlongArray jdmats, jobjectArray jevnames, jobjectArray jout) {
|
||||
BoosterHandle handle = (BoosterHandle) jhandle;
|
||||
DMatrixHandle* dmats = 0;
|
||||
@ -406,11 +406,11 @@ JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGBoosterEvalOneIter
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: org_dmlc_xgboost4j_XgboostJNI
|
||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
||||
* Method: XGBoosterPredict
|
||||
* Signature: (JJIJ)[F
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGBoosterPredict
|
||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterPredict
|
||||
(JNIEnv *jenv, jclass jcls, jlong jhandle, jlong jdmat, jint joption_mask, jint jntree_limit, jobjectArray jout) {
|
||||
BoosterHandle handle = (BoosterHandle) jhandle;
|
||||
DMatrixHandle dmat = (DMatrixHandle) jdmat;
|
||||
@ -426,11 +426,11 @@ JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGBoosterPredict
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: org_dmlc_xgboost4j_XgboostJNI
|
||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
||||
* Method: XGBoosterLoadModel
|
||||
* Signature: (JLjava/lang/String;)V
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGBoosterLoadModel
|
||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterLoadModel
|
||||
(JNIEnv *jenv, jclass jcls, jlong jhandle, jstring jfname) {
|
||||
BoosterHandle handle = (BoosterHandle) jhandle;
|
||||
const char* fname = jenv->GetStringUTFChars(jfname, 0);
|
||||
@ -441,11 +441,11 @@ JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGBoosterLoadModel
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: org_dmlc_xgboost4j_XgboostJNI
|
||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
||||
* Method: XGBoosterSaveModel
|
||||
* Signature: (JLjava/lang/String;)V
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGBoosterSaveModel
|
||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterSaveModel
|
||||
(JNIEnv *jenv, jclass jcls, jlong jhandle, jstring jfname) {
|
||||
BoosterHandle handle = (BoosterHandle) jhandle;
|
||||
const char* fname = jenv->GetStringUTFChars(jfname, 0);
|
||||
@ -457,11 +457,11 @@ JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGBoosterSaveModel
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: org_dmlc_xgboost4j_XgboostJNI
|
||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
||||
* Method: XGBoosterLoadModelFromBuffer
|
||||
* Signature: (JJJ)V
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGBoosterLoadModelFromBuffer
|
||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterLoadModelFromBuffer
|
||||
(JNIEnv *jenv, jclass jcls, jlong jhandle, jlong jbuf, jlong jlen) {
|
||||
BoosterHandle handle = (BoosterHandle) jhandle;
|
||||
void *buf = (void*) jbuf;
|
||||
@ -469,11 +469,11 @@ JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGBoosterLoadModelFrom
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: org_dmlc_xgboost4j_XgboostJNI
|
||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
||||
* Method: XGBoosterGetModelRaw
|
||||
* Signature: (J)Ljava/lang/String;
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGBoosterGetModelRaw
|
||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterGetModelRaw
|
||||
(JNIEnv * jenv, jclass jcls, jlong jhandle, jobjectArray jout) {
|
||||
BoosterHandle handle = (BoosterHandle) jhandle;
|
||||
bst_ulong len = 0;
|
||||
@ -488,11 +488,11 @@ JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGBoosterGetModelRaw
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: org_dmlc_xgboost4j_XgboostJNI
|
||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
||||
* Method: XGBoosterDumpModel
|
||||
* Signature: (JLjava/lang/String;I)[Ljava/lang/String;
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGBoosterDumpModel
|
||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterDumpModel
|
||||
(JNIEnv *jenv, jclass jcls, jlong jhandle, jstring jfmap, jint jwith_stats, jobjectArray jout) {
|
||||
BoosterHandle handle = (BoosterHandle) jhandle;
|
||||
const char *fmap = jenv->GetStringUTFChars(jfmap, 0);
|
||||
|
||||
@ -1,218 +1,218 @@
|
||||
/* DO NOT EDIT THIS FILE - it is machine generated */
|
||||
#include <jni.h>
|
||||
/* Header for class org_dmlc_xgboost4j_XgboostJNI */
|
||||
/* Header for class ml_dmlc_xgboost4j_XgboostJNI */
|
||||
|
||||
#ifndef _Included_org_dmlc_xgboost4j_XgboostJNI
|
||||
#define _Included_org_dmlc_xgboost4j_XgboostJNI
|
||||
#ifndef _Included_ml_dmlc_xgboost4j_XgboostJNI
|
||||
#define _Included_ml_dmlc_xgboost4j_XgboostJNI
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
/*
|
||||
* Class: org_dmlc_xgboost4j_XgboostJNI
|
||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
||||
* Method: XGBGetLastError
|
||||
* Signature: ()Ljava/lang/String;
|
||||
*/
|
||||
JNIEXPORT jstring JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGBGetLastError
|
||||
JNIEXPORT jstring JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBGetLastError
|
||||
(JNIEnv *, jclass);
|
||||
|
||||
/*
|
||||
* Class: org_dmlc_xgboost4j_XgboostJNI
|
||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
||||
* Method: XGDMatrixCreateFromFile
|
||||
* Signature: (Ljava/lang/String;I[J)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGDMatrixCreateFromFile
|
||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixCreateFromFile
|
||||
(JNIEnv *, jclass, jstring, jint, jlongArray);
|
||||
|
||||
/*
|
||||
* Class: org_dmlc_xgboost4j_XgboostJNI
|
||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
||||
* Method: XGDMatrixCreateFromCSR
|
||||
* Signature: ([J[I[F[J)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGDMatrixCreateFromCSR
|
||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixCreateFromCSR
|
||||
(JNIEnv *, jclass, jlongArray, jintArray, jfloatArray, jlongArray);
|
||||
|
||||
/*
|
||||
* Class: org_dmlc_xgboost4j_XgboostJNI
|
||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
||||
* Method: XGDMatrixCreateFromCSC
|
||||
* Signature: ([J[I[F[J)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGDMatrixCreateFromCSC
|
||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixCreateFromCSC
|
||||
(JNIEnv *, jclass, jlongArray, jintArray, jfloatArray, jlongArray);
|
||||
|
||||
/*
|
||||
* Class: org_dmlc_xgboost4j_XgboostJNI
|
||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
||||
* Method: XGDMatrixCreateFromMat
|
||||
* Signature: ([FIIF[J)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGDMatrixCreateFromMat
|
||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixCreateFromMat
|
||||
(JNIEnv *, jclass, jfloatArray, jint, jint, jfloat, jlongArray);
|
||||
|
||||
/*
|
||||
* Class: org_dmlc_xgboost4j_XgboostJNI
|
||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
||||
* Method: XGDMatrixSliceDMatrix
|
||||
* Signature: (J[I[J)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGDMatrixSliceDMatrix
|
||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixSliceDMatrix
|
||||
(JNIEnv *, jclass, jlong, jintArray, jlongArray);
|
||||
|
||||
/*
|
||||
* Class: org_dmlc_xgboost4j_XgboostJNI
|
||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
||||
* Method: XGDMatrixFree
|
||||
* Signature: (J)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGDMatrixFree
|
||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixFree
|
||||
(JNIEnv *, jclass, jlong);
|
||||
|
||||
/*
|
||||
* Class: org_dmlc_xgboost4j_XgboostJNI
|
||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
||||
* Method: XGDMatrixSaveBinary
|
||||
* Signature: (JLjava/lang/String;I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGDMatrixSaveBinary
|
||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixSaveBinary
|
||||
(JNIEnv *, jclass, jlong, jstring, jint);
|
||||
|
||||
/*
|
||||
* Class: org_dmlc_xgboost4j_XgboostJNI
|
||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
||||
* Method: XGDMatrixSetFloatInfo
|
||||
* Signature: (JLjava/lang/String;[F)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGDMatrixSetFloatInfo
|
||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixSetFloatInfo
|
||||
(JNIEnv *, jclass, jlong, jstring, jfloatArray);
|
||||
|
||||
/*
|
||||
* Class: org_dmlc_xgboost4j_XgboostJNI
|
||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
||||
* Method: XGDMatrixSetUIntInfo
|
||||
* Signature: (JLjava/lang/String;[I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGDMatrixSetUIntInfo
|
||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixSetUIntInfo
|
||||
(JNIEnv *, jclass, jlong, jstring, jintArray);
|
||||
|
||||
/*
|
||||
* Class: org_dmlc_xgboost4j_XgboostJNI
|
||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
||||
* Method: XGDMatrixSetGroup
|
||||
* Signature: (J[I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGDMatrixSetGroup
|
||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixSetGroup
|
||||
(JNIEnv *, jclass, jlong, jintArray);
|
||||
|
||||
/*
|
||||
* Class: org_dmlc_xgboost4j_XgboostJNI
|
||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
||||
* Method: XGDMatrixGetFloatInfo
|
||||
* Signature: (JLjava/lang/String;[[F)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGDMatrixGetFloatInfo
|
||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixGetFloatInfo
|
||||
(JNIEnv *, jclass, jlong, jstring, jobjectArray);
|
||||
|
||||
/*
|
||||
* Class: org_dmlc_xgboost4j_XgboostJNI
|
||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
||||
* Method: XGDMatrixGetUIntInfo
|
||||
* Signature: (JLjava/lang/String;[[I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGDMatrixGetUIntInfo
|
||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixGetUIntInfo
|
||||
(JNIEnv *, jclass, jlong, jstring, jobjectArray);
|
||||
|
||||
/*
|
||||
* Class: org_dmlc_xgboost4j_XgboostJNI
|
||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
||||
* Method: XGDMatrixNumRow
|
||||
* Signature: (J[J)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGDMatrixNumRow
|
||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGDMatrixNumRow
|
||||
(JNIEnv *, jclass, jlong, jlongArray);
|
||||
|
||||
/*
|
||||
* Class: org_dmlc_xgboost4j_XgboostJNI
|
||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
||||
* Method: XGBoosterCreate
|
||||
* Signature: ([J[J)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGBoosterCreate
|
||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterCreate
|
||||
(JNIEnv *, jclass, jlongArray, jlongArray);
|
||||
|
||||
/*
|
||||
* Class: org_dmlc_xgboost4j_XgboostJNI
|
||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
||||
* Method: XGBoosterFree
|
||||
* Signature: (J)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGBoosterFree
|
||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterFree
|
||||
(JNIEnv *, jclass, jlong);
|
||||
|
||||
/*
|
||||
* Class: org_dmlc_xgboost4j_XgboostJNI
|
||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
||||
* Method: XGBoosterSetParam
|
||||
* Signature: (JLjava/lang/String;Ljava/lang/String;)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGBoosterSetParam
|
||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterSetParam
|
||||
(JNIEnv *, jclass, jlong, jstring, jstring);
|
||||
|
||||
/*
|
||||
* Class: org_dmlc_xgboost4j_XgboostJNI
|
||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
||||
* Method: XGBoosterUpdateOneIter
|
||||
* Signature: (JIJ)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGBoosterUpdateOneIter
|
||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterUpdateOneIter
|
||||
(JNIEnv *, jclass, jlong, jint, jlong);
|
||||
|
||||
/*
|
||||
* Class: org_dmlc_xgboost4j_XgboostJNI
|
||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
||||
* Method: XGBoosterBoostOneIter
|
||||
* Signature: (JJ[F[F)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGBoosterBoostOneIter
|
||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterBoostOneIter
|
||||
(JNIEnv *, jclass, jlong, jlong, jfloatArray, jfloatArray);
|
||||
|
||||
/*
|
||||
* Class: org_dmlc_xgboost4j_XgboostJNI
|
||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
||||
* Method: XGBoosterEvalOneIter
|
||||
* Signature: (JI[J[Ljava/lang/String;[Ljava/lang/String;)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGBoosterEvalOneIter
|
||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterEvalOneIter
|
||||
(JNIEnv *, jclass, jlong, jint, jlongArray, jobjectArray, jobjectArray);
|
||||
|
||||
/*
|
||||
* Class: org_dmlc_xgboost4j_XgboostJNI
|
||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
||||
* Method: XGBoosterPredict
|
||||
* Signature: (JJIJ[[F)I
|
||||
* Signature: (JJII[[F)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGBoosterPredict
|
||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterPredict
|
||||
(JNIEnv *, jclass, jlong, jlong, jint, jint, jobjectArray);
|
||||
|
||||
/*
|
||||
* Class: org_dmlc_xgboost4j_XgboostJNI
|
||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
||||
* Method: XGBoosterLoadModel
|
||||
* Signature: (JLjava/lang/String;)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGBoosterLoadModel
|
||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterLoadModel
|
||||
(JNIEnv *, jclass, jlong, jstring);
|
||||
|
||||
/*
|
||||
* Class: org_dmlc_xgboost4j_XgboostJNI
|
||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
||||
* Method: XGBoosterSaveModel
|
||||
* Signature: (JLjava/lang/String;)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGBoosterSaveModel
|
||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterSaveModel
|
||||
(JNIEnv *, jclass, jlong, jstring);
|
||||
|
||||
/*
|
||||
* Class: org_dmlc_xgboost4j_XgboostJNI
|
||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
||||
* Method: XGBoosterLoadModelFromBuffer
|
||||
* Signature: (JJJ)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGBoosterLoadModelFromBuffer
|
||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterLoadModelFromBuffer
|
||||
(JNIEnv *, jclass, jlong, jlong, jlong);
|
||||
|
||||
/*
|
||||
* Class: org_dmlc_xgboost4j_XgboostJNI
|
||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
||||
* Method: XGBoosterGetModelRaw
|
||||
* Signature: (J[Ljava/lang/String;)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGBoosterGetModelRaw
|
||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterGetModelRaw
|
||||
(JNIEnv *, jclass, jlong, jobjectArray);
|
||||
|
||||
/*
|
||||
* Class: org_dmlc_xgboost4j_XgboostJNI
|
||||
* Class: ml_dmlc_xgboost4j_XgboostJNI
|
||||
* Method: XGBoosterDumpModel
|
||||
* Signature: (JLjava/lang/String;I[[Ljava/lang/String;)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_dmlc_xgboost4j_XgboostJNI_XGBoosterDumpModel
|
||||
JNIEXPORT jint JNICALL Java_ml_dmlc_xgboost4j_XgboostJNI_XGBoosterDumpModel
|
||||
(JNIEnv *, jclass, jlong, jstring, jint, jobjectArray);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
package org.dmlc.xgboost4j;
|
||||
package ml.dmlc.xgboost4j;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
import org.apache.commons.logging.Log;
|
||||
@ -21,7 +21,6 @@ import org.apache.commons.logging.LogFactory;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
/**
|
||||
* test cases for Booster
|
||||
@ -43,7 +42,7 @@ public class BoosterImplTest {
|
||||
}
|
||||
|
||||
@Override
|
||||
public float eval(float[][] predicts, org.dmlc.xgboost4j.DMatrix dmat) {
|
||||
public float eval(float[][] predicts, DMatrix dmat) {
|
||||
float error = 0f;
|
||||
float[] labels;
|
||||
try {
|
||||
@ -67,8 +66,8 @@ public class BoosterImplTest {
|
||||
|
||||
@Test
|
||||
public void testBoosterBasic() throws XGBoostError {
|
||||
org.dmlc.xgboost4j.DMatrix trainMat = new org.dmlc.xgboost4j.DMatrix("../../demo/data/agaricus.txt.train");
|
||||
org.dmlc.xgboost4j.DMatrix testMat = new org.dmlc.xgboost4j.DMatrix("../../demo/data/agaricus.txt.test");
|
||||
DMatrix trainMat = new DMatrix("../../demo/data/agaricus.txt.train");
|
||||
DMatrix testMat = new DMatrix("../../demo/data/agaricus.txt.test");
|
||||
|
||||
//set params
|
||||
Map<String, Object> paramMap = new HashMap<String, Object>() {
|
||||
@ -81,7 +80,7 @@ public class BoosterImplTest {
|
||||
};
|
||||
|
||||
//set watchList
|
||||
HashMap<String, org.dmlc.xgboost4j.DMatrix> watches = new HashMap<>();
|
||||
HashMap<String, DMatrix> watches = new HashMap<>();
|
||||
|
||||
watches.put("train", trainMat);
|
||||
watches.put("test", testMat);
|
||||
@ -112,7 +111,7 @@ public class BoosterImplTest {
|
||||
@Test
|
||||
public void testCV() throws XGBoostError {
|
||||
//load train mat
|
||||
org.dmlc.xgboost4j.DMatrix trainMat = new org.dmlc.xgboost4j.DMatrix("../../demo/data/agaricus.txt.train");
|
||||
DMatrix trainMat = new DMatrix("../../demo/data/agaricus.txt.train");
|
||||
|
||||
//set params
|
||||
Map<String, Object> param = new HashMap<String, Object>() {
|
||||
@ -13,10 +13,9 @@
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
package org.dmlc.xgboost4j;
|
||||
package ml.dmlc.xgboost4j;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
import org.dmlc.xgboost4j.*;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.Arrays;
|
||||
@ -32,7 +31,7 @@ public class DMatrixTest {
|
||||
@Test
|
||||
public void testCreateFromFile() throws XGBoostError {
|
||||
//create DMatrix from file
|
||||
org.dmlc.xgboost4j.DMatrix dmat = new org.dmlc.xgboost4j.DMatrix("../../demo/data/agaricus.txt.test");
|
||||
DMatrix dmat = new DMatrix("../../demo/data/agaricus.txt.test");
|
||||
//get label
|
||||
float[] labels = dmat.getLabel();
|
||||
//check length
|
||||
@ -56,7 +55,7 @@ public class DMatrixTest {
|
||||
float[] data = new float[]{1, 2, 3, 4, 2, 3, 5, 3, 1, 2, 5};
|
||||
int[] colIndex = new int[]{0, 2, 3, 0, 2, 3, 4, 0, 1, 2, 3};
|
||||
long[] rowHeaders = new long[]{0, 3, 7, 11};
|
||||
org.dmlc.xgboost4j.DMatrix dmat1 = new org.dmlc.xgboost4j.DMatrix(rowHeaders, colIndex, data, org.dmlc.xgboost4j.DMatrix.SparseType.CSR);
|
||||
DMatrix dmat1 = new DMatrix(rowHeaders, colIndex, data, DMatrix.SparseType.CSR);
|
||||
//check row num
|
||||
System.out.println(dmat1.rowNum());
|
||||
TestCase.assertTrue(dmat1.rowNum() == 3);
|
||||
@ -85,7 +84,7 @@ public class DMatrixTest {
|
||||
label0[i] = random.nextFloat();
|
||||
}
|
||||
|
||||
org.dmlc.xgboost4j.DMatrix dmat0 = new org.dmlc.xgboost4j.DMatrix(data0, nrow, ncol);
|
||||
DMatrix dmat0 = new DMatrix(data0, nrow, ncol);
|
||||
dmat0.setLabel(label0);
|
||||
|
||||
//check
|
||||
@ -75,7 +75,7 @@ if [ ${TASK} == "java_test" ]; then
|
||||
set -e
|
||||
make jvm-packages
|
||||
cd jvm-packages
|
||||
./create_wrap.sh
|
||||
./create_jni.sh
|
||||
mvn clean install -DskipTests=true
|
||||
mvn test
|
||||
fi
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user