Example usage for weka.core SparseInstance value

List of usage examples for weka.core SparseInstance value

Introduction

In this page you can find the example usage for weka.core SparseInstance value.

Prototype

@Override
public double value(int attIndex) 

Source Link

Document

Returns an instance's attribute value in internal format.

Usage

From source file:datalib.SparseInstances.java

License:Open Source License

public double getElement(int instIndex, int attrIndex) {
    if (instIndex < 0 || instIndex > m_Instances.size() || attrIndex < 0 || attrIndex > m_Attributes.size()) {
        System.out.println("error: wrong parameter!\n");
        return -1.0;
    }/*from  w  w  w .  j av  a 2  s .co  m*/
    SparseInstance instance = (SparseInstance) m_Instances.elementAt(instIndex);
    return instance.value(attrIndex);
}