Connect WEKA to MySQL

I am attending a Data Mining class here in London and hopefully I am quite interested in the field and I like it a lot.

Since I started my own research on the topic too, and I have tons of commercial data in the databases I administer for playing around, I found a very nice, free and open source tool (Can it get any better?) for the job, WEKA.
(Waikato Environment for Knowledge Analysis)

It is developed at the University of Waikato, New Zealand. Weka is free software available under the GNU General Public License.

One of the nice things of the software is that it uses JDBC (Java Database Connectivity), so you can connect to any database that supplies you with a JDBC driver. Also there is a JDBC to ODBC bridge driver, in order to connect to ODBC supported databases. So to sum things up, you can connect to almost every decent database management system.

Anyway, in theory it works really well, but there is a grey zone on how to practically connect to a database when using WEKA.

By using google, the first results and also WEKA’s website FAQ were suggesting to add the libraries to your classpath, either for user-wide or system-wide. I simply don’t want to do that, if you start doing that for each application, then your computer will be a mess. That’s clearly my opinion. So I just started exploring WEKA’s programme folder and saw a RunWeka.ini file.

There, you have the chance to add libraries without messing with classpath variables and settings.The only thing I had to do was to add the line:

cp=%CLASSPATH%;C:/Dropbox/Java_Libraries/mysql-connector-java-5.1.16/mysql-connector-java-5.1.16-bin.jar

at the end of the file and start WEKA from RunWeka.bat.

Easily and nicely done. Happy Data Mining!

5 thoughts on “Connect WEKA to MySQL”

  1. I want to voice my affection for your generosity supporting visitors who really need guidance on this issue. Your real dedication to passing the message along came to be certainly useful and has continuously encouraged professionals like me to arrive at their ambitions. Your invaluable help denotes much to me and further more to my mates. Many thanks; from everyone of us.

  2. It’s actually a great and helpful piece of info. I am glad that you just shared this useful info with us. Please keep us up to date like this. Thanks for sharing.

Leave a Reply