5.0

5.0 | 3 ratings Rate this file 70 downloads (last 30 days) File Size: 1.56 KB File ID: #19260

Using Weka in Matlab

by Muhammad Shoaib Sehgal

 

18 Mar 2008 (Updated 07 Apr 2008)

Code covered by BSD License  

Example file how to use weka (written in Java) in Matlab

Download Now | Watch this File

File Information
Description

The file demonstrates interfacing Java with Matlab by using weka (Machine learning software, written in JAVA) as an example.

MATLAB release MATLAB 7.2 (R2006a)
Zip File Content  
Other Files license.txt,
WekaInMatlab.m
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (5)
19 Mar 2008 Jorge Diaz-Ramirez

Excellent file..
Thank

26 Aug 2009 Daria Skripko

Hi Muhammad, I find this very usful for me.
But if I run this example in Matlab I've got the following error:

-----------------------------------------------------
 ??? Java exception occurred:
java.lang.Exception:
Weka exception: No source has been specified

General options:

-h or -help
Output help information.
-synopsis or -info
Output synopsis for classifier (use in conjunction with -h)
-t <name of training file>
Sets training file.
-T <name of test file>
....
-E weka.classifiers.bayes.net.estimate.SimpleEstimator
Estimator algorithm

at weka.classifiers.Evaluation.evaluateModel(Unknown Source)

Error in ==> weka_example at 22
Evaluation.evaluateModel(javaObject('weka.classifiers.bayes.BayesNet'),prm);

------------------------------------------------------------------

Could you please help me?

Daria

26 Aug 2009 Daria Skripko  
26 Aug 2009 Daria Skripko

That's great!

26 Aug 2009 Muhammad Shoaib Sehgal

Here are some leads which might be helpful

1- From the error it seems the arff files are not available at:

v2 = java.lang.String('WEKA_HOME\trainData.arff');
v4 = java.lang.String('WEKA_HOME\testDATA.arff');

Can you check them and share what you are using Weka_Home?

2- Jut to be clear you are using it on windows? and for Mac/Unix you'd need to use / instead of \ to specify the path.

3- It seems some versions of weka are case sensitive so just make sure you use the same case (lower case) for the file extension.

https://list.scms.waikato.ac.nz/pipermail/wekalist/2008-August/014326.html

Please login to add a comment or rating.
Updates
24 Mar 2008

Description update

07 Apr 2008

update description

Tag Activity for this File
Tag Applied By Date/Time
external interface Muhammad Shoaib Sehgal 22 Oct 2008 09:54:12
weka Muhammad Shoaib Sehgal 22 Oct 2008 09:54:12
java Muhammad Shoaib Sehgal 22 Oct 2008 09:54:12
external code interfacing Muhammad Shoaib Sehgal 22 Oct 2008 09:54:12
machine learning Muhammad Shoaib Sehgal 22 Oct 2008 09:54:12
external code interfacing Kashif Naveed 26 Jun 2009 05:52:55
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com