XGBoost method in WEKA investigator

294 views
Skip to first unread message

Anatoliy Zhadan

unread,
Sep 22, 2021, 6:53:57 AM9/22/21
to The ADAMS Flow User mailing list
Hi Peter!
A little question regarding the XGBoost method
in ADAMS. Is it possible to apply this method for regression? In environment R  I use it without problems, but in WEKA investigator (if I use the default method parameters) I get the following error -

[Classify] Failed to evaluate classifier
java.lang.Exception: Failed to cross-validate:
Fold #1 failed to evaluate'process' failed with exception: java.lang.NoClassDefFoundError: Could not initialize class ml.dmlc.xgboost4j.java.XGBoostJNI
at ml.dmlc.xgboost4j.java.DMatrix.<init>(DMatrix.java:141)
at weka.classifiers.trees.XGBoost.instancesToDMatrix(XGBoost.java:1780)
at weka.classifiers.trees.XGBoost.buildClassifier(XGBoost.java:1609)
at adams.multiprocess.WekaCrossValidationJob.process(WekaCrossValidationJob.java:217)
at adams.multiprocess.AbstractJob.execute(AbstractJob.java:186)
at adams.multiprocess.LocalJobRunner$1.doCall(LocalJobRunner.java:275)
at adams.multiprocess.LocalJobRunner$1.doCall(LocalJobRunner.java:273)
at adams.multiprocess.CallableWithResult.call(CallableWithResult.java:54)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

at adams.gui.tools.wekainvestigator.tab.classifytab.evaluation.CrossValidation.doEvaluate(CrossValidation.java:401)
at adams.gui.tools.wekainvestigator.tab.classifytab.evaluation.AbstractClassifierEvaluation.evaluate(AbstractClassifierEvaluation.java:94)
at adams.gui.tools.wekainvestigator.tab.ClassifyTab$1.doRun(ClassifyTab.java:915)
at adams.gui.tools.wekainvestigator.job.InvestigatorTabJob.run(InvestigatorTabJob.java:94)
at java.lang.Thread.run(Unknown Source)




_________
regards
Anatoliy

Peter Reutemann

unread,
Sep 22, 2021, 4:19:58 PM9/22/21
to ADAMS user list
Hi Anatoliy

> A little question regarding the XGBoost method
> in ADAMS. Is it possible to apply this method for regression? In environment R I use it without problems, but in WEKA investigator (if I use the default method parameters) I get the following error -
>
> [Classify] Failed to evaluate classifier
> java.lang.Exception: Failed to cross-validate:
> Fold #1 failed to evaluate'process' failed with exception: java.lang.NoClassDefFoundError: Could not initialize class ml.dmlc.xgboost4j.java.XGBoostJNI
> at ml.dmlc.xgboost4j.java.DMatrix.<init>(DMatrix.java:141)

[...]

That error message points at a problem with XGBoost not being able to
load its native library (which is part of the XGBoost jar).
I just downloaded a snapshot of adams-ml-app and ran XGBoost
successfully on the "bolts" UCI dataset. I'm using OpenJDK 11 (build
11.0.11+9-Ubuntu-0ubuntu2.20.04).

What operating system and Java version are you using?

Cheers, Peter
--
Peter Reutemann
Dept. of Computer Science
University of Waikato, NZ
+64 (7) 858-5174 (office)
+64 (7) 577-5304 (home office)
http://www.cms.waikato.ac.nz/~fracpete/
http://www.data-mining.co.nz/

Anatoliy Zhadan

unread,
Sep 23, 2021, 3:39:20 AM9/23/21
to theadams...@googlegroups.com
Добре, дякую.
Я працюю в Win 7. Я завантажив ваш новий знімок. Тепер метод X GBoost працює дуже нестабільно. Часто видає таке повідомлення після ненормального припинення роботи слідчого WEKA методом XGBoost - 

Додаток несподівано вийшов із кодом виходу -1073741819, параметри, що використовуються для запуску процесу:

C: \ Program Files \ Java \ jre1.8.0_301 \ bin \
java.exe -Xmx512m
-classpath
D: \ adams-addons-all-snapshot-bin \ adams-addons-all-21.9.0-SNAPSHOT \ bin \\ .. \ resources; D: \ adams-addons-all-snapshot-bin \ adams-addons- all-21.9.0-SNAPSHOT \ bin \ .. \ lib \ windows64 \ *; D: \ adams-addons-all-snapshot-bin \ adams-addons-all-21.9.0-SNAPSHOT \ bin \ .. \ lib \ *
adams.gui.Main -enable
-restart




-priority \ java-cup-11b -20160615.jar



-doc-dir
D: \ adams-addons-all-snapshot-bin \ adams-addons-all-21.9.0-SNAPSHOT \ bin \\ .. \ docs
-title
ADAMS-Addons


Однак, якщо я використовую Weka-Explorer, то таких помилок немає.

з повагою, 
Anatoliy

ср, 22 вер. 2021 о 23:19 'Peter Reutemann' via The ADAMS Flow User mailing list <theadams...@googlegroups.com> пише:
--
You received this message because you are subscribed to a topic in the Google Groups "The ADAMS Flow User mailing list" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/theadamsflow-user/YEX1TUA2pBA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to theadamsflow-u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/theadamsflow-user/CAHoQ12%2BU4WSfRwBzCYOVgN3bBcF_HZyg%3DOK65CmZc-heySDyqA%40mail.gmail.com.

Anatoliy Zhadan

unread,
Sep 23, 2021, 3:44:28 AM9/23/21
to theadams...@googlegroups.com
sorry, accidentally sent it in not English.

Ok, thank you.
I'm working on Win 7. I've uploaded your new snapshot. Now the XGBoost method is very unstable. Often issues such a message after the abnormal termination of the  WEKA investigator with XGBoost method  -

The application came out unexpectedly with the exit code -1073741819, the parameters used to start the process:


C: \ Program Files \ Java \ jre1.8.0_301 \ bin \
java.exe -Xmx512m
-classpath
D: \ adams-addons-all-snapshot-bin \ adams-addons-all-21.9.0-SNAPSHOT \ bin \\ .. \ resources; D: \ adams-addons-all-snapshot-bin \ adams-addons-all-21.9.0-SNAPSHOT \ bin \ .. \ lib \ windows64 \ *; D: \ adams-addons-all-snapshot-bin \ adams-addons-all-21.9.0-SNAPSHOT \ bin \ .. \ lib \ *

adams.gui.Main -enable
-restart




-priority \ java-cup-11b -20160615.jar



-doc-dir
D: \ adams-addons-all-snapshot-bin \ adams-addons-all-21.9.0-SNAPSHOT \ bin \\ .. \ docs
-title
ADAMS-Addons


However, if I use Weka-Explorer, there are no such errors.

best regards,
Anatoliy

чт, 23 вер. 2021 о 10:38 Anatoliy Zhadan <zhadan...@gmail.com> пише:

Peter Reutemann

unread,
Sep 23, 2021, 4:51:55 PM9/23/21
to ADAMS user list
> I'm working on Win 7. I've uploaded your new snapshot. Now the XGBoost method is very unstable. Often issues such a message after the abnormal termination of the WEKA investigator with XGBoost method -

ADAMS relies on a third-party jar for XGBoost called xgboost4j:
https://mvnrepository.com/artifact/ml.dmlc/xgboost4j

Since these jars are wrapping native libraries, support for various
platforms depends on what libraries have been packaged.
Up till last week, only Linux was supported with version 0.82 of the
library (we only needed XGBoost for a comparison a few years ago, so
didn't care about cross-platform).
Yesterday, I upgraded to 1.4.1, which now supports Linux, Mac, Windows
(in theory). Under Linux, I had no problem running on a regression
dataset it with default settings.

R and Python will have their own wrappers around the native libraries,
the Java wrapper one seems a bit neglected.

If you can use XGBoost via the scikitlearn plugin in Weka, keep using
it like that if you are on Windows.

Anatoliy Zhadan

unread,
Sep 24, 2021, 2:37:36 AM9/24/21
to theadams...@googlegroups.com
Ok, I got it. Thank you very much.

regards
Anatoliy

чт, 23 вер. 2021 о 23:51 'Peter Reutemann' via The ADAMS Flow User mailing list <theadams...@googlegroups.com> пише:
--
You received this message because you are subscribed to a topic in the Google Groups "The ADAMS Flow User mailing list" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/theadamsflow-user/YEX1TUA2pBA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to theadamsflow-u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages