Example usage for weka.core InstanceComparator compare

List of usage examples for weka.core InstanceComparator compare

Introduction

In this page you can find the example usage for weka.core InstanceComparator compare.

Prototype

public int compare(Instance inst1, Instance inst2) 

Source Link

Document

compares the two instances, returns -1 if o1 is smaller than o2, 0 if equal and +1 if greater.

Usage

From source file:lu.lippmann.cdb.lab.beta.util.WekaUtil2.java

License:Open Source License

/**
 * /*from  w ww. j av  a2 s .c o m*/
 * @param instances
 * @param instance
 */
public static void removeFromInstances(Instances instances, Instance instance) {
    InstanceComparator cp = new InstanceComparator();
    for (int i = 0; i < instances.numInstances(); i++) {
        Instance cinstance = instances.instance(i);
        if (cp.compare(cinstance, instance) == 0) {
            instances.remove(cinstance);
            break;
        }
    }
}