程序包 weka.experiment
类 InstanceQuery
java.lang.Object
weka.experiment.DatabaseUtils
weka.experiment.InstanceQuery
- 所有已实现的接口:
Serializable
,OptionHandler
,RevisionHandler
Convert the results of a database query into instances. The jdbc driver and
database to be used default to "jdbc.idbDriver" and
"jdbc:idb=experiments.prp". These may be changed by creating a java
properties file called DatabaseUtils.props in user.home or the current
directory. eg:
jdbcDriver=jdbc.idbDriver
jdbcURL=jdbc:idb=experiments.prp
Command line use just outputs the instances to System.out.
Valid options are:-Q <query> SQL query to execute.
-S Return sparse rather than normal instances.
-U <username> The username to use for connecting.
-P <password> The password to use for connecting.
-D Enables debug output.
- 版本:
- $Revision: 11887 $
- 作者:
- Len Trigg (trigg@cs.waikato.ac.nz)
- 另请参阅:
-
字段概要
从类继承的字段 weka.experiment.DatabaseUtils
BOOL, BYTE, DATE, DOUBLE, EXP_INDEX_TABLE, EXP_RESULT_COL, EXP_RESULT_PREFIX, EXP_SETUP_COL, EXP_TYPE_COL, FLOAT, INTEGER, LONG, PROPERTY_FILE, SHORT, STRING, TEXT, TIME, TIMESTAMP
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明String[]
Gets the current settings of InstanceQuerygetQuery()
Get the query to execute against the databaseReturns the revision string.boolean
Gets whether data is to be returned as a set of sparse instancesReturns an enumeration describing the available optionsstatic void
Test the class from the command line.Returns the tip text for this propertyMakes a database query using the query set through the -Q option to convert a table into a set of instancesretrieveInstances
(String query) Makes a database query to convert a table into a set of instancesvoid
setOptions
(String[] options) Parses a given list of options.void
Set the query to execute against the databasevoid
setSparseData
(boolean s) Sets whether data should be encoded as sparse instancesReturns the tip text for this property从类继承的方法 weka.experiment.DatabaseUtils
arrayToString, close, close, connectToDatabase, createExperimentIndex, createExperimentIndexEntry, createResultsTable, databaseURLTipText, debugTipText, disconnectFromDatabase, execute, experimentIndexExists, getDatabaseURL, getDebug, getKeywords, getKeywordsMaskChar, getPassword, getResultFromTable, getResultSet, getResultsTableName, getSupportedCursorScrollType, getUsername, isConnected, isCursorScrollable, isCursorScrollSensitive, isKeyword, maskKeyword, passwordTipText, processKeyString, putResultInTable, select, setDatabaseURL, setDebug, setKeywords, setKeywordsMaskChar, setPassword, setUsername, tableExists, translateDBColumnType, typeName, update, usernameTipText
-
构造器详细资料
-
InstanceQuery
Sets up the database drivers- 抛出:
Exception
- if an error occurs
-
-
方法详细资料
-
listOptions
Returns an enumeration describing the available options- 指定者:
listOptions
在接口中OptionHandler
- 返回:
- an enumeration of all options
-
setOptions
Parses a given list of options. Valid options are:-Q <query> SQL query to execute.
-S Return sparse rather than normal instances.
-U <username> The username to use for connecting.
-P <password> The password to use for connecting.
-D Enables debug output.
- 指定者:
setOptions
在接口中OptionHandler
- 参数:
options
- the list of options as an array of strings- 抛出:
Exception
- if an option is not supported
-
queryTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setQuery
Set the query to execute against the database- 参数:
q
- the query to execute
-
getQuery
Get the query to execute against the database- 返回:
- the query
-
sparseDataTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setSparseData
public void setSparseData(boolean s) Sets whether data should be encoded as sparse instances- 参数:
s
- true if data should be encoded as a set of sparse instances
-
getSparseData
public boolean getSparseData()Gets whether data is to be returned as a set of sparse instances- 返回:
- true if data is to be encoded as sparse instances
-
getOptions
Gets the current settings of InstanceQuery- 指定者:
getOptions
在接口中OptionHandler
- 返回:
- an array of strings suitable for passing to setOptions()
-
retrieveInstances
Makes a database query using the query set through the -Q option to convert a table into a set of instances- 返回:
- the instances contained in the result of the query
- 抛出:
Exception
- if an error occurs
-
retrieveInstances
Makes a database query to convert a table into a set of instances- 参数:
query
- the query to convert to instances- 返回:
- the instances contained in the result of the query, NULL if the SQL query doesn't return a ResultSet, e.g., DELETE/INSERT/UPDATE
- 抛出:
Exception
- if an error occurs
-
main
Test the class from the command line. The instance query should be specified with -Q sql_query- 参数:
args
- contains options for the instance query
-
getRevision
Returns the revision string.- 指定者:
getRevision
在接口中RevisionHandler
- 覆盖:
getRevision
在类中DatabaseUtils
- 返回:
- the revision
-