Class InstanceSet

java.lang.Object
  extended by InstanceSet

public class InstanceSet
extends java.lang.Object

An InstanceSet is a set of instances to be used in a machine learning problem, generally as either a training set or a test set.

Author:
jmac

Field Summary
static java.lang.String commentStart
          The character used to start comments in .arff files.
 
Constructor Summary
InstanceSet(AttributeSet attributeSet, java.util.ArrayList<Instance> instances)
          Construct an InstanceSet from a list of instances
InstanceSet(java.lang.String inputFilename)
          Construct an InstanceSet by reading a .arff file with the given filename
 
Method Summary
 AttributeSet getAttributeSet()
          Get the set of attributes used by all the instances in this instance set.
 java.util.ArrayList<Instance> getInstances()
          Get a list of all instances in this instance set.
 int getNumInstances()
          Get the number of instances in this instance set.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

commentStart

public static final java.lang.String commentStart
The character used to start comments in .arff files.

See Also:
Constant Field Values
Constructor Detail

InstanceSet

public InstanceSet(java.lang.String inputFilename)
            throws DecisionTreeException,
                   java.io.IOException
Construct an InstanceSet by reading a .arff file with the given filename

Parameters:
inputFilename - name of the file to read
Throws:
java.io.IOException
DecisionTreeException
java.io.IOException
java.lang.Exception

InstanceSet

public InstanceSet(AttributeSet attributeSet,
                   java.util.ArrayList<Instance> instances)
Construct an InstanceSet from a list of instances

Parameters:
attributeSet - the set of attributes for this set of instances
instances - a list of the instances to be stored in the instance set
Method Detail

getAttributeSet

public AttributeSet getAttributeSet()
Get the set of attributes used by all the instances in this instance set.

Returns:
the attributeSet

getInstances

public java.util.ArrayList<Instance> getInstances()
Get a list of all instances in this instance set.

Returns:
the instances

getNumInstances

public int getNumInstances()
Get the number of instances in this instance set.

Returns:
the number of instances in this set of instances