dice.data
Interface Instances

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
CVInstances, SimpleInstances

public interface Instances
extends java.io.Serializable

An Instances stores a data set in memory.

Author:
Zhang Xiatian
See Also:
Instance

Method Summary
 Instance get(int index)
          Get an instance by the assigned index or position.
 int[] getAttributes()
          Get the arrays, whose elements indicate the types of attributes.
 int getAttrSize()
          Get the number of attributes.
 int[][] getIds()
          Get the index matrix.
 double[][] getMat()
          Get the data matrix.
 java.lang.String getRelation()
          Get the relation name of the data set.
 boolean isSparse()
          Get the storage status of the Instances.
 java.util.Iterator<Instance> iterator()
          Return a Iterator of the Instance
 void setData(int[][] ids, double[][] mat)
          Put the index and data matrix into it.
 void setMiss(double miss)
          Set the default value for the ignored element in the sparse storage form.
 int size()
          Get the number of Instances.
 

Method Detail

getAttributes

int[] getAttributes()
Get the arrays, whose elements indicate the types of attributes. 0 indicates the attribute is numeric or real attribute. The number is greater than 0 indicate the numbers of values of each attributes.

Returns:
The attribute type indicator array.

iterator

java.util.Iterator<Instance> iterator()
Return a Iterator of the Instance

Returns:
The iteraotr of Instance.

size

int size()
Get the number of Instances.

Returns:
The number of Instances.

getAttrSize

int getAttrSize()
Get the number of attributes.

Returns:
The number of attributes.

getRelation

java.lang.String getRelation()
Get the relation name of the data set.

Returns:
The relation name of the data set.

get

Instance get(int index)
Get an instance by the assigned index or position.

Parameters:
index - The index or position of the Instance wanted.
Returns:
The instance wanted.

isSparse

boolean isSparse()
Get the storage status of the Instances.

Returns:
If the data storage form is sparse, then return true. Otherwise, return false.

getIds

int[][] getIds()
Get the index matrix.

Returns:
The index matrix. If the isSparse() return false, the return will be null.

getMat

double[][] getMat()
Get the data matrix.

Returns:
The data matrix.

setData

void setData(int[][] ids,
             double[][] mat)
Put the index and data matrix into it.

Parameters:
ids - The index matrix.
mat - The data matrix.

setMiss

void setMiss(double miss)
Set the default value for the ignored element in the sparse storage form.

Parameters:
miss -