org.apache.mahout.classifier.df.data
Class Instance

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

public class Instance
extends Object

Represents one data instance.


Constructor Summary
Instance(Vector attrs)
           
 
Method Summary
 boolean equals(Object obj)
           
 double get(int index)
          Return the attribute at the specified position
 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(Vector attrs)
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:
value - a double value to set

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2008–2014 The Apache Software Foundation. All rights reserved.