Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] jvm-package of LightGBM #157

Closed
geoHeil opened this issue Jan 2, 2017 · 6 comments
Closed

[Feature] jvm-package of LightGBM #157

geoHeil opened this issue Jan 2, 2017 · 6 comments

Comments

@geoHeil
Copy link

geoHeil commented Jan 2, 2017

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.

@ekerazha
Copy link

ekerazha commented Jan 3, 2017

Here https://github.com/Microsoft/LightGBM/wiki/Features they say Spark support is planned. A XGBoost4J alternative would certainly be nice.

@superbobry
Copy link

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?

@guolinke
Copy link
Collaborator

@superbobry refer to #909

@imatiach-msft
Copy link
Contributor

@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.

@jaykelin
Copy link

@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)

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity since it was closed. To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants