So far LightGBM does not offer a JVM integration like https://github.com/dmlc/xgboost/tree/master/jvm-packages What is the current state? Is anyone working on a JVM integration?
Maybe https://github.com/java-native-access/jna starting out with https://code.google.com/archive/p/jnaerator/ would be an interesting start.
https://github.com/Microsoft/LightGBM/blob/master/python-package/lightgbm/basic.py seems to define all the C interactions which are outlined in https://github.com/Microsoft/LightGBM/blob/master/include/LightGBM/c_api.h and could be used as input for jnaerator.
Here https://github.com/Microsoft/LightGBM/wiki/Features they say Spark support is planned. A XGBoost4J alternative would certainly be nice.
Just out of curiosity, why was the issue closed even though it was labelled as call-for-contribution? Is JVM support no longer in the roadmap?
@superbobry refer to https://github.com/Microsoft/LightGBM/issues/909
@superbobry I've checked in the code to generate SWIG Java wrappers to LightGBM
To build, you just need to run:
mkdir build ; cd build
cmake -DUSE_SWIG=ON ..
make -j4
The jar file is also available in maven central:
https://repo.maven.apache.org/maven2/com/microsoft/ml/lightgbm/lightgbmlib/
You can import it with sbt via:
"com.microsoft.ml.lightgbm" % "lightgbmlib" % "2.0.120"
If you have any suggestions for how to improve the SWIG wrappers please let me know.
@imatiach-msft catch an exception like java.lang.ClassNotFoundException: com.microsoft.ml.lightgbm.SWIGTYPE_p_void
spark-shell --jars mmlspark-0.12.jar,lightgbmlib-2.0.120.jar
traning model
import com.microsoft.ml.spark.LightGBMClassifier
val lgbm = new LightGBMClassifier().setLabelCol("dep_delayed_15min").setFeaturesCol("newColumn").setRawPredictionCol("rawPrediction").setNumLeaves(5).setNumIterations(10)
val lgbmModel = lgbm.fit(tmpData)
Most helpful comment
Here https://github.com/Microsoft/LightGBM/wiki/Features they say Spark support is planned. A XGBoost4J alternative would certainly be nice.