xydrolase / shap4j

JVM bindings for the SHAP library
MIT License
6 stars 0 forks source link

Getting UnsatisfiedLinkError while trying to run TreeExplainer on LightGBM model #12

Open Bhuvanamitra opened 8 months ago

Bhuvanamitra commented 8 months ago

I have converted LIghtGBM model into .shap4j format and trying to execute TreeExplainer using the example shared in the repo. But I am getting following error:

Exception in thread "main" java.lang.UnsatisfiedLinkError: no jniTreeEnsemble in java.library.path: [/usr/java/packages/lib, /usr/lib64, /lib64, /lib, /usr/lib] at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2673) at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:830) at java.base/java.lang.System.loadLibrary(System.java:1873) at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:1832) at org.bytedeco.javacpp.Loader.load(Loader.java:1423) at org.bytedeco.javacpp.Loader.load(Loader.java:1234) at org.bytedeco.javacpp.Loader.load(Loader.java:1210) at shap4j.shap.TreeEnsemble.<clinit>(TreeEnsemble.java:16) at shap4j.TreeExplainer.<init>(TreeExplainer.java:36) at javashap.JavaShap.main(JavaShap.java:15) Caused by: java.lang.UnsatisfiedLinkError: Could not find jniTreeEnsemble in class, module, and library paths. at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:1799) ... 6 more

I am not able to figure out what is going wrong here. Kindly help. I am attaching the model for reproducing this issue. This model needs a feature array with 2020 features. model_shap4j.txt (Modified name because it is not allowing to attach file with .shap4j extension. The file name is model.shap4j)

chmonica-chowdary commented 4 months ago

@Bhuvanamitra @xydrolase I am also facing the same issue while using the example provided in the repo, is there any resolution for this issue. Thanks.