weka类型映射
weka只支持4个数据类型,跟数据库对不上号,所以需要自己手动将数据库读出来的数据映射成weka支持的类型才能进行处理
配置文件位置在/src/weka/experiment/DatabaseUtils.props
# General information on database access can be found here:
# http://weka.wikispaces.com/Databases
#
# Version: $Revision: 5836 $
# The comma-separated list of jdbc drivers to use
#jdbcDriver=RmiJdbc.RJDriver,jdbc.idbDriver
#jdbcDriver=jdbc.idbDriver
#jdbcDriver=com.microsoft.sqlserver.jdbc.SQLServerDriver
jdbcDriver=org.gjt.mm.mysql.Driver
jdbcDriver=com.microsoft.sqlserver.jdbc.SQLServerDriver
# The url to the experiment database
#jdbcURL=jdbc:rmi://expserver/jdbc:idb=experiments.prp
jdbcURL=jdbc:sqlserver://192.168.0.153:1433;databaseName=Credit
jdbcURL=jdbc:mysql://mysqlserver/username
#jdbcDriver=org.gjt.mm.mysql.Driver
#jdbcURL=jdbc:idb=experiments.prp
#上面部分为数据库信息及驱动配置
#下面部分将各种类型映射为weka可识别的四种类型,大小写敏感。
# the method that is used to retrieve values from the db
# (java datatype + RecordSet.<method>)
string, getString() = 0; --> nominal
boolean, getBoolean() = 1; --> nominal
double, getDouble() = 2; --> numeric
byte, getByte() = 3; --> numeric
short, getByte()= 4; --> numeric
int, getInteger() = 5; --> numeric
long, getLong() = 6; --> numeric
float, getFloat() = 7; --> numeric
date, getDate() = 8; --> date
text, getString() = 9; --> string
time, getTime() = 10; --> date
# the original conversion: <column type>=<conversion>
#char=0
varchar=0
#longvarchar=0
#binary=0
#varbinary=0
#longvarbinary=0
#bit=1
numeric=2
#decimal=2
tinyint=3
smallint=4
int=5
#integer=5
bigint=6
#real=7
float=2
#double=2
#date=8
#time=10
#timestamp=8
#mysql-conversion
CHAR=0
TEXT=0
VARCHAR=0
LONGVARCHAR=9
BINARY=0
VARBINARY=0
LONGVARBINARY=9
BIT=1
NUMERIC=2
DECIMAL=2
FLOAT=2
DOUBLE=2
TINYINT=3
SMALLINT=4
#SHORT=4
SHORT=5
INTEGER=5
BIGINT=6
LONG=6
REAL=7
DATE=8
TIME=10
TIMESTAMP=8
nvarchar=0
text=0
CREATE_STRING=TEXT
CREATE_INT=INT
CREATE_DOUBLE=DOUBLE
CREATE_FLOAT=FLOAT
CREATE_DATE=DATETIME
DateFormat=yyyy-MM-dd HH:mm:ss
checkUpperCaseNames=false
checkLowerCaseNames=false
checkForTable=true
setAutoCommit=true
createIndex=false
Keywords=\
AND,\
ASC,\
BY,\
DESC,\
FROM,\
GROUP,\
INSERT,\
ORDER,\
SELECT,\
UPDATE,\
WHERE
KeywordsMaskChar=_
nominalToStringLimit=50
idColumn=auto_generated_id