org.apache.mahout.df.data
Class Instance

java.lang.Object
  extended by org.apache.mahout.df.data.Instance

public class Instance
extends java.lang.Object

Represents one data instance.


Constructor Summary
Instance(int id, Vector attrs, int label)
           
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 double get(int index)
          Return the attribute at the specified position
 int getId()
          instance unique id
 int getLabel()
          instance label code.
use Dataset.labels to get the real label value
 int hashCode()
           
 void set(int index, double value)
          Set the value at the given index
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Instance

public Instance(int id,
                Vector attrs,
                int label)
Method Detail

get

public double get(int index)
Return the attribute at the specified position

Parameters:
index - position of the attribute to retrieve
Returns:
value of the attribute

set

public void set(int index,
                double value)
Set the value at the given index

Parameters:
index -
value - a double value to set

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

getId

public int getId()
instance unique id


getLabel

public int getLabel()
instance label code.
use Dataset.labels to get the real label value



Copyright © 2008-2010 The Apache Software Foundation. All Rights Reserved.