Code covered by the BSD License  

Highlights from
Matlab Weka Interface

4.16667

4.2 | 6 ratings Rate this file 110 Downloads (last 30 days) File Size: 76.2 KB File ID: #21204

Matlab Weka Interface

by Matt Dunham

 

24 Aug 2008 (Updated 25 Aug 2008)

Matlab interface for Weka Classifiers

| Watch this File

File Information
Description

Weka is a comprehensive open source Machine Learning toolkit, written in Java at the University of Waikato, New Zealand. These functions provide a basic Matlab interface to Weka allowing you to transfer data back and forth and access major Weka features, such as training Classifiers. They have been tested with Weka version 3.5

MATLAB release MATLAB 7.6 (R2008a)
Other requirements Requires Java and Weka, available here: http://www.cs.waikato.ac.nz/ml/weka/
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (12)
31 Oct 2008 Fangqing Peng

what you have write here is so useful to me.
but can you list a intruduction about how to use your files here . thx.

my email: jidoua@126.com

23 Feb 2009 Sunny Mahajan

Hi Matt, I would find this extremely useful if I could use it.
I ran wekaNBexample.m got the following error:

??? Undefined function or variable 'FastVector'.

Error in ==> matlab2weka at 28
    vec = FastVector();

Error in ==> wekaNBexample at 21
train = matlab2weka('iris-train',featureNames,train,classindex);

Can you please help?
-Sunny

07 Apr 2009 leptogenesis

As others have said, the usability could use some work. I just turned a .mat file into a .arff file using this, but at first, I was entering the data matrix the wrong way (should have used the transpose). When I did this, the program created the Instances object with no errors, and would then throw a cryptic nullpointerexception when I tried to write the arff file. It took half an hour going through the weka source code to figure out what was happening--a range check in your program would have saved me that time.

Otherwise, a very useful program!

21 Apr 2009 Philip  
13 May 2010 Matteo

Very useful!

26 Oct 2010 Jorge

Hi Matt,
I'm using weka-3.6 and matlab 7.6 (R2008a). The program loadARFF.m is experiencing the following error:
?? Java exception occurred:
java.io.IOException: The specified source has Been
at weka.core.converters.ArffLoader.getDataSet (ArffLoader.java: 1003)
Error in ==> loadARFF at 20
    wekaOBJ loader.getDataSet = ();

I am passing the file name correctly.
Can you please help?
Jorge.

25 Mar 2011 Kenneth

Saved me a heap of time, thank you.

the matlab2weka file has a bit of a problem. "Instance" can't be substantiated. Quick work around is to use SparseInstance and create a filter in SaveAsArff to convert sparse to non-sparse.

28 Mar 2011 Kenneth

sorry - substantiated should of course be instantiated.

14 Jul 2011 Arturo Moncada Torres  
26 Jul 2011 Kyle Heuton

Great code, but I can't figure out how to enter options that contain a numeric value, it has to be a cell array of strings, and I've tried:
{'-F','1'},{'-F 1'},{-F <1>}, and every other permutation I can think of, but none of them work.

What is the proper way to enter options that contain a value?

26 Oct 2011 Pierluigi Failla

I tried your code with using functions.SMO with parameter the standard Weka string:

'-C 1.0 -L 0.0010 -P 1.0E-12 -N 0 -V -1 -W 1 -K "weka.classifiers.functions.supportVector.PolyKernel -C 250007 -E 1.0"'

and everything works fine, but when I try to do the same using lazy.IBk classifier with string parameter:

'-K 1 -W 0 -A "weka.core.neighboursearch.LinearNNSearch -A \"weka.core.EuclideanDistance -R first-last\""'

(copied from Weka) I get an Illegal Option error.

Do you have any idea to fix this?

Thanks

21 Jan 2012 shab shekan

Thank you so much.
I try it but I have problem.
I got this error " No method 'setValue' with matching signature found for class
'weka.core.Instance'."
Do you have any idea to fix this?

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
statistics Matt Dunham 22 Oct 2008 10:15:51
probability Matt Dunham 22 Oct 2008 10:15:51
weka Matt Dunham 22 Oct 2008 10:15:51
java Matt Dunham 22 Oct 2008 10:15:51
machine learning Matt Dunham 22 Oct 2008 10:15:51
classifier Matt Dunham 22 Oct 2008 10:15:51
matlab2weka Matt Dunham 22 Oct 2008 10:15:51
weka2matlab Matt Dunham 22 Oct 2008 10:15:51
weka Philip 21 Apr 2009 14:17:59
classifier Juan 06 Dec 2010 10:02:53
java Juan 06 Dec 2010 10:02:59
machine learning Juan 06 Dec 2010 10:03:00
classifier Muhammad 28 Dec 2010 08:27:28
machine learning Rafael Nebot 29 Oct 2011 15:04:36
classifier Yu 06 Dec 2011 15:42:48

Contact us at files@mathworks.com