|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--weka.experiment.DatabaseUtils | +--weka.experiment.InstanceQuery
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.
Field Summary |
Fields inherited from class 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, SHORT, STRING |
Constructor Summary | |
InstanceQuery()
Sets up the database drivers |
Method Summary | |
java.lang.String[] |
getOptions()
Gets the current settings of InstanceQuery |
java.lang.String |
getQuery()
Get the query to execute against the database |
boolean |
getSparseData()
Gets whether data is to be returned as a set of sparse instances |
java.util.Enumeration |
listOptions()
Returns an enumeration describing the available options |
static void |
main(java.lang.String[] args)
Test the class from the command line. |
java.lang.String |
queryTipText()
Returns the tip text for this property |
Instances |
retrieveInstances()
Makes a database query using the query set through the -Q option to convert a table into a set of instances |
Instances |
retrieveInstances(java.lang.String query)
Makes a database query to convert a table into a set of instances |
void |
setOptions(java.lang.String[] options)
Parses a given list of options. |
void |
setQuery(java.lang.String q)
Set the query to execute against the database |
void |
setSparseData(boolean s)
Sets whether data should be encoded as sparse instances |
java.lang.String |
sparseDataTipText()
Returns the tip text for this property |
Methods inherited from class weka.experiment.DatabaseUtils |
arrayToString, connectToDatabase, createExperimentIndex, createExperimentIndexEntry, createResultsTable, databaseURLTipText, disconnectFromDatabase, execute, experimentIndexExists, getDatabaseURL, getPassword, getResultFromTable, getResultSet, getResultsTableName, getUsername, isConnected, putResultInTable, setDatabaseURL, setPassword, setUsername, tableExists, typeName |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public InstanceQuery() throws java.lang.Exception
java.lang.Exception
- if an error occursMethod Detail |
public java.util.Enumeration listOptions()
listOptions
in interface OptionHandler
public void setOptions(java.lang.String[] options) throws java.lang.Exception
-S
Return a set of sparse instances rather than normal instances.
setOptions
in interface OptionHandler
options
- the list of options as an array of strings
java.lang.Exception
- if an option is not supportedpublic java.lang.String queryTipText()
public void setQuery(java.lang.String q)
q
- the query to executepublic java.lang.String getQuery()
public java.lang.String sparseDataTipText()
public void setSparseData(boolean s)
s
- true if data should be encoded as a set of sparse instancespublic boolean getSparseData()
public java.lang.String[] getOptions()
getOptions
in interface OptionHandler
public Instances retrieveInstances() throws java.lang.Exception
java.lang.Exception
- if an error occurspublic Instances retrieveInstances(java.lang.String query) throws java.lang.Exception
query
- the query to convert to instances
java.lang.Exception
- if an error occurspublic static void main(java.lang.String[] args)
args
- contains options for the instance query
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright (c) 2003 David Lindsay, Computer Learning Research Centre, Dept. Computer Science, Royal Holloway, University of London