Example usage for weka.core.converters DatabaseSaver setDestination

List of usage examples for weka.core.converters DatabaseSaver setDestination

Introduction

In this page you can find the example usage for weka.core.converters DatabaseSaver setDestination.

Prototype

public void setDestination() 

Source Link

Document

Sets the database url using the DatabaseUtils file.

Usage

From source file:core.DatabaseSaverEx.java

License:Open Source License

/**
 * Main method./*from ww  w .j ava  2s .c o  m*/
 *
 * @param options should contain the options of a Saver.
 */
public static void main(String[] options) {

    StringBuffer text = new StringBuffer();
    text.append("\n\nDatabaseSaver options:\n");
    try {
        DatabaseSaver asv = new DatabaseSaver();
        try {
            Enumeration enumi = asv.listOptions();
            while (enumi.hasMoreElements()) {
                Option option = (Option) enumi.nextElement();
                text.append(option.synopsis() + '\n');
                text.append(option.description() + '\n');
            }
            asv.setOptions(options);
            asv.setDestination();
        } catch (Exception ex) {
            ex.printStackTrace();
        }
        //incremental

        /*asv.setRetrieval(INCREMENTAL);
        Instances instances = asv.getInstances();
        asv.setStructure(instances);
        for(int i = 0; i < instances.numInstances(); i++){ //last instance is null and finishes incremental saving
            asv.writeIncremental(instances.instance(i));
        }
        asv.writeIncremental(null);*/

        //batch
        asv.writeBatch();
    } catch (Exception ex) {
        ex.printStackTrace();
        System.out.println(text);
    }

}