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

Error occurs when tring to use SMO -C for parameter tuning #63

Closed
acadTags opened this issue Jan 27, 2020 · 2 comments
Closed

Error occurs when tring to use SMO -C for parameter tuning #63

acadTags opened this issue Jan 27, 2020 · 2 comments
Labels

Comments

@acadTags
Copy link

In the meka wrapper, I tried to run HOMER or BR with SVM and to tune the value of -C in SVM.

However, error occurs at the prediction stage, is it because the -C has been occupied by meka? When -C 1.0 is removed, the program works fine.

The prediction command is below

java -cp "C:\Users\xxx\scikit_ml_learn_data\meka\meka-release-1.9.2\lib\*" meka.classifiers.multilabel.BR -W weka.classifiers.functions.SMO -C 1.0 -t "C:\Users\xxx\AppData\Local\Temp\tmp8k72pc2i.arff" -T "C:\Users\xxx\AppData\Local\Temp\tmppka5mk9h.arff" -verbosity 5 -l "C:\Users\xxx\AppData\Local\Temp\tmpzp4xpsjt"

@fracpete
Copy link
Member

The option handling (inherited from Weka) can be sometimes a bit confusing. The "-W" option usually only takes a single argument, which is the scheme name. Options for that scheme have to be supplied after the "--" meta-option, which has to be placed at the end of the command. Your command would therefore look like this:
java -cp "C:\Users\xxx\scikit_ml_learn_data\meka\meka-release-1.9.2\lib*" meka.classifiers.multilabel.BR -W weka.classifiers.functions.SMO -t "C:\Users\xxx\AppData\Local\Temp\tmp8k72pc2i.arff" -T "C:\Users\xxx\AppData\Local\Temp\tmppka5mk9h.arff" -verbosity 5 -l "C:\Users\xxx\AppData\Local\Temp\tmpzp4xpsjt" -- -C 1.0

I'd recommend to use the Meka Explorer to configure your scheme, copy/paste the commandline (via right-click) and then just add the java call at the start and all other general options (datasets, verbosity, ...) right after the first classname.

Please use the Meka mailing list for asking questions:
https://sourceforge.net/projects/meka/lists/meka-list

@acadTags
Copy link
Author

The option handling (inherited from Weka) can be sometimes a bit confusing. The "-W" option usually only takes a single argument, which is the scheme name. Options for that scheme have to be supplied after the "--" meta-option, which has to be placed at the end of the command. Your command would therefore look like this:
java -cp "C:\Users\xxx\scikit_ml_learn_data\meka\meka-release-1.9.2\lib*" meka.classifiers.multilabel.BR -W weka.classifiers.functions.SMO -t "C:\Users\xxx\AppData\Local\Temp\tmp8k72pc2i.arff" -T "C:\Users\xxx\AppData\Local\Temp\tmppka5mk9h.arff" -verbosity 5 -l "C:\Users\xxx\AppData\Local\Temp\tmpzp4xpsjt" -- -C 1.0

I'd recommend to use the Meka Explorer to configure your scheme, copy/paste the commandline (via right-click) and then just add the java call at the start and all other general options (datasets, verbosity, ...) right after the first classname.

Please use the Meka mailing list for asking questions:
https://sourceforge.net/projects/meka/lists/meka-list

Great! This solved my problem, thanks!

acadTags pushed a commit to acadTags/scikit-multilearn that referenced this issue Jan 28, 2020
The change will allow the wrapper to construct java command that contains both MEKA and WEKA parameters.

the below function will be able to work, which can specify SMO parameters, this leads to an error in the previous version. See also the question Waikato/meka#63.

meka = Meka(
        meka_classifier = "meka.classifiers.multilabel.MULAN -S HOMER.BalancedClustering.3.ClassifierChain", # Binary Relevance
        weka_classifier = "weka.classifiers.functions.SMO -C 0.1", # with Naive Bayes single-label classifier
        meka_classpath = meka_classpath, #obtained via download_meka
        java_command = 'java', # path to java executable
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants