- #Configure weka jar how to#
- #Configure weka jar install#
- #Configure weka jar driver#
- #Configure weka jar code#
Instances newData = eFilter(data, remove) // apply filter tInputFormat(data) // inform filter about dataset **AFTER** setting options Remove remove = new Remove() // new instance of filter If you have an Instances object, called data, you can create and apply the filter like this: import Most filters implement the OptionHandler interface, which means you can set the options via a String array, rather than setting them each manually via set-methods.įor example, if you want to remove the first attribute of a dataset, you need this filter .Remove FilterĮither takes the class attribute into account or notĮ.g., removing a certain attribute or removing instances that meet a certain condition tOptions(("-C 1.0 -L 0.0010 -P 1.0E-12 -N 0 -V -1 -W 1 -K \".PolyKernel -C 250007 -E 1.0\"")) Īlso, the OptionTree.java tool allows you to view a nested options string, e.g., used at the command line, as a tree. Will generate output like this: // create new instance of scheme Especially handy if the command line contains nested classes that have their own options, such as kernels for SMO:
#Configure weka jar how to#
The Windows databases article explains how to do this. * For MS Access, you must use the JDBC-ODBC-bridge that is part of a JDK.
#Configure weka jar driver#
* Don't forget to add the JDBC driver to your CLASSPATH. Instances data = query.retrieveInstances() You can declare that your data set is sparse InstanceQuery query = new InstanceQuery()
#Configure weka jar code#
Secondly, your Java code needs to look like this to load the data from the database: import JdbcURL=jdbc:mysql://localhost:3306/some_database Your props file must contain the following lines: jdbcDriver=.mysql.Driver Since you're only reading, you can use the default user nobody without a password. (The driver class is .mysql.Driver.) The database where your target data resides is called some_database. The MySQL JDBC driver is called Connector/J. Suppose you want to connect to a MySQL server that is running on the local machine on the default port 3306. First, you'll have to modify your DatabaseUtils.props file to reflect your database connection. Reading from Databases is slightly more complicated, but still very easy. For example, the XRFF format saves the class attribute information as wellĭata.setClassIndex(data.numAttributes() - 1) setting class attribute if the data format does not provide this information import .DataSource ĭataSource source = new DataSource("/some/where/data.arff") It can also read CSV files and other formats (basically all file formats that Weka can import via its converters it uses the file extension to determine the associated loader). The DataSource class is not limited to ARFF files. The classifiers and filters always list their options in the Javadoc API ( stable, developer version) specification.Ī comprehensive source of information is the chapter Using the API of the Weka manual.
A link to an example class can be found at the end of this page, under the Links section. The following sections explain how to use them in your own code.
#Configure weka jar install#
Install rJava inside R with install.packages('rJava')
Install Rplugin with Weka Package Manager Replace the old info.Plist with the new one given by Mark Hall The easy one has already specified in the post link in the question:
Finally I got this to work with the following steps: