Example usage for weka.core Instances SERIALIZED_OBJ_FILE_EXTENSION

List of usage examples for weka.core Instances SERIALIZED_OBJ_FILE_EXTENSION

Introduction

In this page you can find the example usage for weka.core Instances SERIALIZED_OBJ_FILE_EXTENSION.

Prototype

String SERIALIZED_OBJ_FILE_EXTENSION

To view the source code for weka.core Instances SERIALIZED_OBJ_FILE_EXTENSION.

Click Source Link

Document

The filename extension that should be used for bin.

Usage

From source file:model.clasification.ClassificationIO.java

public static void writeInstanceObject(String fileName, Instances fullIstances) {

    //pravi kopiju instanci
    Instances instances = new Instances(fullIstances);

    //brise sve instance, ostavlja samo informacije o atributima, samo zaglavlje
    instances.delete();/*  w  ww . ja v a  2  s.co m*/
    try {
        SerializationHelper.write(
                "methods/classification/instances/" + fileName + Instances.SERIALIZED_OBJ_FILE_EXTENSION,
                instances);
    } catch (Exception e) {
    }

}

From source file:model.clasification.ClassificationIO.java

/**
 * Ovo su ogoljne instance sadrze samo informaicje o atributima
 *
 * @param fileName//ww w.  j ava 2  s .c o  m
 * @return ogoljene instance
 */
public static Instances readInstances(String fileName) {
    String path = "methods/classification/instances/" + fileName + Instances.SERIALIZED_OBJ_FILE_EXTENSION;
    Instances instances = null;
    try {
        instances = (Instances) SerializationHelper.read(path);

    } catch (Exception ex) {
        Logger.getLogger(ClassificationIO.class.getName()).log(Level.SEVERE, null, ex);
    }

    return instances;

}

From source file:model.clustering.ClusterIO.java

public void writeInstanceObject(String fileName, Instances fullIstances) {

    //pravi kopiju instanci
    Instances instances = new Instances(fullIstances);

    //brise sve instance, ostavlja samo informacije o atributima, samo zaglavlje
    instances.delete();/*from   w  ww . ja  v  a2 s . co  m*/
    try {
        SerializationHelper.write(
                "methods/clustering/instances/" + fileName + Instances.SERIALIZED_OBJ_FILE_EXTENSION,
                instances);
    } catch (Exception e) {
    }

}