添加数据库驱动程序以使用WEKA类 [英] Adding database drivers to use WEKA classes

查看:182
本文介绍了添加数据库驱动程序以使用WEKA类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在命令行上运行以下命令:

I tried to run the following command on the command-line:

G:\Weka-3-6>java weka.core.converters.CSVLoader data.csv > data.arff

这是错误讯息:

---Registering Weka Editors---
Trying to add database driver (JDBC): RmiJdbc.RJDriver - Error, not in CLASSPATH?
Trying to add database driver (JDBC): jdbc.idbDriver - Error, not in CLASSPATH?
Trying to add database driver (JDBC): org.gjt.mm.mysql.Driver - Error, not in CLASSPATH?
Trying to add database driver (JDBC): com.mckoi.JDBCDriver - Error, not in CLASSPATH?
Trying to add database driver (JDBC): org.hsqldb.jdbcDriver - Error, not in CLASSPATH?
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
    at java.util.Hashtable.<init>(Unknown Source)
    at java.util.Hashtable.<init>(Unknown Source)
    at java.util.Properties.propertyNames(Unknown Source)
    at weka.core.ProtectedProperties.<init>(ProtectedProperties.java:55)
    at weka.core.Attribute.<init>(Attribute.java:215)
    at weka.core.converters.CSVLoader.readHeader(CSVLoader.java:744)
    at weka.core.converters.CSVLoader.readStructure(CSVLoader.java:416)
    at weka.core.converters.CSVLoader.getStructure(CSVLoader.java:401)
    at weka.core.converters.CSVLoader.getDataSet(CSVLoader.java:434)
    at weka.core.converters.AbstractFileLoader.runFileLoader(AbstractFileLoader.java:323)
    at weka.core.converters.CSVLoader.main(CSVLoader.java:804)

我看到它说的是将数据库驱动程序添加到类路径。将数据库驱动程序添加到类路径中的步骤是什么?还有,我需要额外的软件包吗?

I do see that it speaks something about adding the database drivers to the classpath. What are the steps in adding the database drivers to the classpath? Also, would I need additional software packages?

推荐答案

错误是因为weka找不到数据库驱动程序。

Hi there are are a couple of points there The initial JDBC errors are because weka cannot find the database drivers.

Trying to add database driver (JDBC): RmiJdbc.RJDriver - Error, not in CLASSPATH?
Trying to add database driver (JDBC): jdbc.idbDriver - Error, not in CLASSPATH?
Trying to add database driver (JDBC): org.gjt.mm.mysql.Driver - Error, not in CLASSPATH?
Trying to add database driver (JDBC): com.mckoi.JDBCDriver - Error, not in CLASSPATH?
Trying to add database driver (JDBC): org.hsqldb.jdbcDriver - Error, not in CLASSPATH?

这是从CSV加载不是一个主要问题,但如果你想配置数据库连接正确然后看
http:// weka.wikispaces.com/How+do+I+connect+to+a+database%3F

This isn't a major issue as you are loading from CSV but if you want to configure the database connectivity properly then look at http://weka.wikispaces.com/How+do+I+connect+to+a+database%3F

第二个问题

Exception in thread "main" java.lang.OutOfMemoryError: Java heap space

是因为您尝试加载的CSV为大到默认的java堆。
我不知道你的数据文件是多大,但我运行weka与大约2gb在我的机器上的-Xmx参数你可以尝试。

is due to the CSV you are trying to load being to large for the default java heap. I don't know how large your data file is but i run weka with about 2gb on my machine with the -Xmx argument you could try.

java -Xmx2200M java weka.core.converters.CSVLoader data.csv > data.arff

其中2200M是您要分配的内存量。

where 2200M is the amount of memory you wish to allocate.

这篇关于添加数据库驱动程序以使用WEKA类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆