2

カスタム分類子を Weka に追加したい。この分類子はjarファイルにあります。これを Weka フォルダーに入れて、このコマンドを実行しますjava -classpath "D:/weka/ancl.jar;D:/weka_bin/weka.jar" weka.gui.GUIChooser 。Weka は正常に実行されますが、分類子リストに分類子が見つかりません。

GenericObjectEditor.props ファイルに対してこの分類子も試しましたが、上記のコマンドで weka を実行すると、エクスプローラー ボタンを押すとこの例外が発生します。

$ java -classpath "D:/weka/ancl.jar;D:/weka_bin/weka.jar"  weka.gui.GUIChooser
---Registering Weka Editors---
Checking class: weka.core.MathematicalExpression
java.lang.ExceptionInInitializerError
        java.lang.Class.forName0(Native Method)
        java.lang.Class.forName(Unknown Source)
        weka.core.ClassDiscovery.find(ClassDiscovery.java:416)
        weka.core.AllJavadoc.<clinit>(AllJavadoc.java:59)
        java.lang.Class.forName0(Native Method)
        java.lang.Class.forName(Unknown Source)
        weka.core.ClassDiscovery.find(ClassDiscovery.java:416)
        weka.gui.GenericPropertiesCreator.generateOutputProperties(GenericProper                                                                     tiesCreator.java:455)
        weka.gui.GenericPropertiesCreator.execute(GenericPropertiesCreator.java:                                                                     534)
        weka.core.converters.ConverterUtils.<clinit>(ConverterUtils.java:714)
        weka.gui.ConverterFileChooser.<clinit>(ConverterFileChooser.java:110)
        weka.gui.explorer.PreprocessPanel.<init>(PreprocessPanel.java:162)
        weka.gui.explorer.Explorer.<init>(Explorer.java:184)
        weka.gui.GUIChooser.showExplorer(GUIChooser.java:1074)
        weka.gui.GUIChooser$17.actionPerformed(GUIChooser.java:928)
        javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
        javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
        javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
        javax.swing.DefaultButtonModel.setPressed(Unknown Source)
        javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
        java.awt.Component.processMouseEvent(Unknown Source)
        javax.swing.JComponent.processMouseEvent(Unknown Source)
        java.awt.Component.processEvent(Unknown Source)
        java.awt.Container.processEvent(Unknown Source)
        java.awt.Component.dispatchEventImpl(Unknown Source)
        java.awt.Container.dispatchEventImpl(Unknown Source)
        java.awt.Component.dispatchEvent(Unknown Source)
        java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
        java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
        java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
        java.awt.Container.dispatchEventImpl(Unknown Source)
        java.awt.Window.dispatchEventImpl(Unknown Source)
        java.awt.Component.dispatchEvent(Unknown Source)
        java.awt.EventQueue.dispatchEventImpl(Unknown Source)
        java.awt.EventQueue.access$000(Unknown Source)
        java.awt.EventQueue$3.run(Unknown Source)
        java.awt.EventQueue$3.run(Unknown Source)
        java.security.AccessController.doPrivileged(Native Method)
        java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
        java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
        java.awt.EventQueue$4.run(Unknown Source)
        java.awt.EventQueue$4.run(Unknown Source)
        java.security.AccessController.doPrivileged(Native Method)
        java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
        java.awt.EventQueue.dispatchEvent(Unknown Source)
        java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
        java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
        java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
        java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        java.awt.EventDispatchThread.run(Unknown Source)

        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Unknown Source)
        at weka.core.ClassDiscovery.find(ClassDiscovery.java:416)
        at weka.core.AllJavadoc.<clinit>(AllJavadoc.java:59)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Unknown Source)
        at weka.core.ClassDiscovery.find(ClassDiscovery.java:416)
        at weka.gui.GenericPropertiesCreator.generateOutputProperties(GenericPro                                                                     pertiesCreator.java:455)
        at weka.gui.GenericPropertiesCreator.execute(GenericPropertiesCreator.ja                                                                     va:534)
        at weka.core.converters.ConverterUtils.<clinit>(ConverterUtils.java:714)
        at weka.gui.ConverterFileChooser.<clinit>(ConverterFileChooser.java:110)
        at weka.gui.explorer.PreprocessPanel.<init>(PreprocessPanel.java:162)
        at weka.gui.explorer.Explorer.<init>(Explorer.java:184)
        at weka.gui.GUIChooser.showExplorer(GUIChooser.java:1074)
        at weka.gui.GUIChooser$17.actionPerformed(GUIChooser.java:928)
        at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
        at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
        at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
        at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
        at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Sour                                                                     ce)
        at java.awt.Component.processMouseEvent(Unknown Source)
        at javax.swing.JComponent.processMouseEvent(Unknown Source)
        at java.awt.Component.processEvent(Unknown Source)
        at java.awt.Container.processEvent(Unknown Source)
        at java.awt.Component.dispatchEventImpl(Unknown Source)
        at java.awt.Container.dispatchEventImpl(Unknown Source)
        at java.awt.Component.dispatchEvent(Unknown Source)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
        at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
        at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
        at java.awt.Container.dispatchEventImpl(Unknown Source)
        at java.awt.Window.dispatchEventImpl(Unknown Source)
        at java.awt.Component.dispatchEvent(Unknown Source)
        at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
        at java.awt.EventQueue.access$000(Unknown Source)
        at java.awt.EventQueue$3.run(Unknown Source)
        at java.awt.EventQueue$3.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Sour                                                                     ce)
        at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Sour                                                                     ce)
        at java.awt.EventQueue$4.run(Unknown Source)
        at java.awt.EventQueue$4.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Sour                                                                     ce)
        at java.awt.EventQueue.dispatchEvent(Unknown Source)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.RuntimeException: Uncompilable source code - package java_c                                                                     up.runtime does not exist
        at weka.core.MathematicalExpression.<clinit>(MathematicalExpression.java                                                                     :26)
        ... 51 more
Checking class: weka.core.MathematicalExpression
java.lang.NoClassDefFoundError: Could not initialize class weka.core.Mathematica                                                                     lExpression
        java.lang.Class.forName0(Native Method)
        java.lang.Class.forName(Unknown Source)
        weka.core.ClassDiscovery.find(ClassDiscovery.java:416)
        weka.gui.GenericPropertiesCreator.generateOutputProperties(GenericProper                                                                     tiesCreator.java:455)
        weka.gui.GenericPropertiesCreator.execute(GenericPropertiesCreator.java:                                                                     534)
        weka.core.converters.ConverterUtils.<clinit>(ConverterUtils.java:714)
        weka.gui.ConverterFileChooser.<clinit>(ConverterFileChooser.java:110)
        weka.gui.explorer.PreprocessPanel.<init>(PreprocessPanel.java:162)
        weka.gui.explorer.Explorer.<init>(Explorer.java:184)
        weka.gui.GUIChooser.showExplorer(GUIChooser.java:1074)
        weka.gui.GUIChooser$17.actionPerformed(GUIChooser.java:928)
        javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
        javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
        javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
        javax.swing.DefaultButtonModel.setPressed(Unknown Source)
        javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
        java.awt.Component.processMouseEvent(Unknown Source)
        javax.swing.JComponent.processMouseEvent(Unknown Source)
        java.awt.Component.processEvent(Unknown Source)
        java.awt.Container.processEvent(Unknown Source)
        java.awt.Component.dispatchEventImpl(Unknown Source)
        java.awt.Container.dispatchEventImpl(Unknown Source)
        java.awt.Component.dispatchEvent(Unknown Source)
        java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
        java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
        java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
        java.awt.Container.dispatchEventImpl(Unknown Source)
        java.awt.Window.dispatchEventImpl(Unknown Source)
        java.awt.Component.dispatchEvent(Unknown Source)
        java.awt.EventQueue.dispatchEventImpl(Unknown Source)
        java.awt.EventQueue.access$000(Unknown Source)
        java.awt.EventQueue$3.run(Unknown Source)
        java.awt.EventQueue$3.run(Unknown Source)
        java.security.AccessController.doPrivileged(Native Method)
        java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
        java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
        java.awt.EventQueue$4.run(Unknown Source)
        java.awt.EventQueue$4.run(Unknown Source)
        java.security.AccessController.doPrivileged(Native Method)
        java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
        java.awt.EventQueue.dispatchEvent(Unknown Source)
        java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
        java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
        java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
        java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        java.awt.EventDispatchThread.run(Unknown Source)

        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Unknown Source)
        at weka.core.ClassDiscovery.find(ClassDiscovery.java:416)
        at weka.gui.GenericPropertiesCreator.generateOutputProperties(GenericPro                                                                     pertiesCreator.java:455)
        at weka.gui.GenericPropertiesCreator.execute(GenericPropertiesCreator.ja                                                                     va:534)
        at weka.core.converters.ConverterUtils.<clinit>(ConverterUtils.java:714)
        at weka.gui.ConverterFileChooser.<clinit>(ConverterFileChooser.java:110)
        at weka.gui.explorer.PreprocessPanel.<init>(PreprocessPanel.java:162)
        at weka.gui.explorer.Explorer.<init>(Explorer.java:184)
        at weka.gui.GUIChooser.showExplorer(GUIChooser.java:1074)
        at weka.gui.GUIChooser$17.actionPerformed(GUIChooser.java:928)
        at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
        at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
        at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
        at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
        at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Sour                                                                     ce)
        at java.awt.Component.processMouseEvent(Unknown Source)
        at javax.swing.JComponent.processMouseEvent(Unknown Source)
        at java.awt.Component.processEvent(Unknown Source)
        at java.awt.Container.processEvent(Unknown Source)
        at java.awt.Component.dispatchEventImpl(Unknown Source)
        at java.awt.Container.dispatchEventImpl(Unknown Source)
        at java.awt.Component.dispatchEvent(Unknown Source)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
        at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
        at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
        at java.awt.Container.dispatchEventImpl(Unknown Source)
        at java.awt.Window.dispatchEventImpl(Unknown Source)
        at java.awt.Component.dispatchEvent(Unknown Source)
        at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
        at java.awt.EventQueue.access$000(Unknown Source)
        at java.awt.EventQueue$3.run(Unknown Source)
        at java.awt.EventQueue$3.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Sour                                                                     ce)
        at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Sour                                                                     ce)
        at java.awt.EventQueue$4.run(Unknown Source)
        at java.awt.EventQueue$4.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Sour                                                                     ce)
        at java.awt.EventQueue.dispatchEvent(Unknown Source)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.run(Unknown Source)
Checking class: weka.filters.unsupervised.attribute.MathExpression
java.lang.ExceptionInInitializerError
        java.lang.Class.forName0(Native Method)
        java.lang.Class.forName(Unknown Source)
        weka.core.ClassDiscovery.find(ClassDiscovery.java:416)
        weka.gui.GenericPropertiesCreator.generateOutputProperties(GenericProper                                                                     tiesCreator.java:455)
        weka.gui.GenericPropertiesCreator.execute(GenericPropertiesCreator.java:                                                                     534)
        weka.core.converters.ConverterUtils.<clinit>(ConverterUtils.java:714)
        weka.gui.ConverterFileChooser.<clinit>(ConverterFileChooser.java:110)
        weka.gui.explorer.PreprocessPanel.<init>(PreprocessPanel.java:162)
        weka.gui.explorer.Explorer.<init>(Explorer.java:184)
        weka.gui.GUIChooser.showExplorer(GUIChooser.java:1074)
        weka.gui.GUIChooser$17.actionPerformed(GUIChooser.java:928)
        javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
        javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
        javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
        javax.swing.DefaultButtonModel.setPressed(Unknown Source)
        javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
        java.awt.Component.processMouseEvent(Unknown Source)
        javax.swing.JComponent.processMouseEvent(Unknown Source)
        java.awt.Component.processEvent(Unknown Source)
        java.awt.Container.processEvent(Unknown Source)
        java.awt.Component.dispatchEventImpl(Unknown Source)
        java.awt.Container.dispatchEventImpl(Unknown Source)
        java.awt.Component.dispatchEvent(Unknown Source)
        java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
        java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
        java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
        java.awt.Container.dispatchEventImpl(Unknown Source)
        java.awt.Window.dispatchEventImpl(Unknown Source)
        java.awt.Component.dispatchEvent(Unknown Source)
        java.awt.EventQueue.dispatchEventImpl(Unknown Source)
        java.awt.EventQueue.access$000(Unknown Source)
        java.awt.EventQueue$3.run(Unknown Source)
        java.awt.EventQueue$3.run(Unknown Source)
        java.security.AccessController.doPrivileged(Native Method)
        java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
        java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
        java.awt.EventQueue$4.run(Unknown Source)
        java.awt.EventQueue$4.run(Unknown Source)
        java.security.AccessController.doPrivileged(Native Method)
        java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
        java.awt.EventQueue.dispatchEvent(Unknown Source)
        java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
        java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
        java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
        java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        java.awt.EventDispatchThread.run(Unknown Source)

        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Unknown Source)
        at weka.core.ClassDiscovery.find(ClassDiscovery.java:416)
        at weka.gui.GenericPropertiesCreator.generateOutputProperties(GenericPro                                                                     pertiesCreator.java:455)
        at weka.gui.GenericPropertiesCreator.execute(GenericPropertiesCreator.ja                                                                     va:534)
        at weka.core.converters.ConverterUtils.<clinit>(ConverterUtils.java:714)
        at weka.gui.ConverterFileChooser.<clinit>(ConverterFileChooser.java:110)
        at weka.gui.explorer.PreprocessPanel.<init>(PreprocessPanel.java:162)
        at weka.gui.explorer.Explorer.<init>(Explorer.java:184)
        at weka.gui.GUIChooser.showExplorer(GUIChooser.java:1074)
        at weka.gui.GUIChooser$17.actionPerformed(GUIChooser.java:928)
        at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
        at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
        at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
        at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
        at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Sour                                                                     ce)
        at java.awt.Component.processMouseEvent(Unknown Source)
        at javax.swing.JComponent.processMouseEvent(Unknown Source)
        at java.awt.Component.processEvent(Unknown Source)
        at java.awt.Container.processEvent(Unknown Source)
        at java.awt.Component.dispatchEventImpl(Unknown Source)
        at java.awt.Container.dispatchEventImpl(Unknown Source)
        at java.awt.Component.dispatchEvent(Unknown Source)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
        at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
        at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
        at java.awt.Container.dispatchEventImpl(Unknown Source)
        at java.awt.Window.dispatchEventImpl(Unknown Source)
        at java.awt.Component.dispatchEvent(Unknown Source)
        at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
        at java.awt.EventQueue.access$000(Unknown Source)
        at java.awt.EventQueue$3.run(Unknown Source)
        at java.awt.EventQueue$3.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Sour                                                                     ce)
        at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Sour                                                                     ce)
        at java.awt.EventQueue$4.run(Unknown Source)
        at java.awt.EventQueue$4.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Sour                                                                     ce)
        at java.awt.EventQueue.dispatchEvent(Unknown Source)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.RuntimeException: Uncompilable source code - package java_c                                                                     up.runtime does not exist
        at weka.filters.unsupervised.attribute.MathExpression.<clinit>(MathExpre                                                                     ssion.java:38)
        ... 47 more

Weka の自動クラス検出がどのように機能するか教えてもらえますか? または、実際にそうでない理由:(

4

2 に答える 2

0

私はこれらの指示に従いましたが、すべて問題ありませんでした:

https://waikato.github.io/weka-wiki/writing_classifier/

最後までざっと見てください:

weka.classifiers.trees.Id3 と生成されたクラス weka.classifiers.WekaWrapper の呼び出しの例を次に示します (実際に生成されたコードを疑似分類子でラップします)。

java weka.classifiers.CheckSource \
    -W "weka.classifiers.trees.Id3" \
    -S weka.classifiers.WekaWrapper \
    -t data.arff \
    -c last
于 2012-09-04T13:38:13.770 に答える