PDA

View Full Version : How can I use database for Apriori in command line?



zzmdl
06-20-2008, 02:26 PM
Hi
I already connect Weka with MySQL. And I can get the data through
>>java weka.core.converters.DatabaseLoader -Q "SELECT * FROM ..." -user root
And I also can use Apriori if the input is arff file through
>>java weka.associations.Apriori -t *.arff

But how can I use Apriori directly on the database? Thanks a lot!

Best regards
Ziming Zheng

Mark
06-20-2008, 04:38 PM
Hi,

Weka algorithms can't be run in the database. You can score data using Weka classifiers and clusterers as part of an ETL process using Kettle's WekaScoring plugin.

Cheers,
Mark.

zzmdl
06-21-2008, 05:26 PM
Hi,

Weka algorithms can't be run in the database. You can score data using Weka classifiers and clusterers as part of an ETL process using Kettle's WekaScoring plugin.

Cheers,
Mark.
Thanks. But it looks strange if weka can not run algorithms on database, why it provided the function of connecting database? Can I use

>>java weka.core.converters.DatabaseLoader -Q "SELECT * FROM ..." -user root > a.arff

to create the a.arff file then to apply weka algorithm? Or is there any better way? Thanks again!

Mark
06-21-2008, 08:08 PM
Sorry, I thought you were talking about "in database mining", where models are learned in the database server. You can create ARFF files using InstanceQuery or DatabaseLoader (as you have done), or you can read data directly out of a database from Weka's Explorer GUI or the KnowledgeFlow GUI.

Cheers,
Mark.

zzmdl
06-23-2008, 09:57 AM
Sorry, I thought you were talking about "in database mining", where models are learned in the database server. You can create ARFF files using InstanceQuery or DatabaseLoader (as you have done), or you can read data directly out of a database from Weka's Explorer GUI or the KnowledgeFlow GUI.

Cheers,
Mark.

Thinks for your help! Since I am using Weka in Linux, I only can use command line. Without GUI, can I still read database directly without creating ARFF files? Thinks again!

Mark
06-23-2008, 05:27 PM
Hi
I already connect Weka with MySQL. And I can get the data through
>>java weka.core.converters.DatabaseLoader -Q "SELECT * FROM ..." -user root
And I also can use Apriori if the input is arff file through
>>java weka.associations.Apriori -t *.arff

But how can I use Apriori directly on the database? Thanks a lot!

Best regards
Ziming Zheng

Hi Ziming,

I'm afraid that there is no facility to connect directly to a database from the command line, so you will be stuck with creating ARFF files at present. This is a feature that could probably be added to the command line however. You can file a feature request over at the JIRA site for Weka if you like:

http://jira.pentaho.com/browse/DATAMINING

I can't give any guarantee as to when it will get added though.

Cheers,
Mark.

zzmdl
07-17-2008, 11:47 AM
Thanks a lot!

Hi Ziming,

I'm afraid that there is no facility to connect directly to a database from the command line, so you will be stuck with creating ARFF files at present. This is a feature that could probably be added to the command line however. You can file a feature request over at the JIRA site for Weka if you like:

http://jira.pentaho.com/browse/DATAMINING

I can't give any guarantee as to when it will get added though.

Cheers,
Mark.