marf.Storage
Class TrainingSample

java.lang.Object
  |
  +--marf.Storage.TrainingSample
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
Cluster

public class TrainingSample
extends java.lang.Object
implements java.io.Serializable

TrainingSample contains one item in the training set. Each training sample consists of the feature vector plus information describing that feature vector. Has been extracted from TrainingSet in 0.3.0.

Since:
0.0.1
Version:
$Revision: 1.5 $
Author:
Stephen Sinclair, Serguei Mokhov
See Also:
Serialized Form

Field Summary
protected  double[] adDataVector
          Array represinting either a feature or mean vector describing the cluster.
protected  int iSubjectID
          Which subject this feature vector is associated with.
protected  java.util.Vector oFilenames
          A list of filenames that were used in training for this cluster.
 
Constructor Summary
TrainingSample()
           
 
Method Summary
 void dumpCSV(java.io.BufferedWriter poBufferedWriter)
          Writes one training sample to a CSV file.
 double[] getDataVector()
          Retrieves the data vector.
static java.lang.String getRevision()
          Returns source code revision information.
 int getSubjectID()
          Retrieves Subject ID of a particular training sample.
 void restoreCSV(java.io.BufferedReader poBufferedReader)
          Retrieve one training sample from a CSV file.
 void setDataVector(double[] padDataVector)
          Sets new mean vector.
 void setFilename(java.lang.String pstrFilename)
          Sets a filename of the training sample.
 void setSubjectID(int piSubjectID)
          Sets new Subject ID.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

iSubjectID

protected int iSubjectID
Which subject this feature vector is associated with.


adDataVector

protected double[] adDataVector
Array represinting either a feature or mean vector describing the cluster.


oFilenames

protected java.util.Vector oFilenames
A list of filenames that were used in training for this cluster. Used to avoid duplicate training on the same filename.

Constructor Detail

TrainingSample

public TrainingSample()
Method Detail

setFilename

public final void setFilename(java.lang.String pstrFilename)
Sets a filename of the training sample.

Parameters:
pstrFilename - filename to set

getSubjectID

public final int getSubjectID()
Retrieves Subject ID of a particular training sample.

Returns:
int ID

getDataVector

public final double[] getDataVector()
Retrieves the data vector.

Returns:
array of doubles representing the data for this subject

setSubjectID

public final void setSubjectID(int piSubjectID)
Sets new Subject ID.

Parameters:
piSubjectID - integer ID

setDataVector

public final void setDataVector(double[] padDataVector)
Sets new mean vector.

Parameters:
padDataVector - double array representing the mean vector

dumpCSV

public final void dumpCSV(java.io.BufferedWriter poBufferedWriter)
                   throws StorageException
Writes one training sample to a CSV file.

Parameters:
poBufferedWriter - BufferedWriter
Throws:
StorageException - in case of I/O or otherwise error

restoreCSV

public final void restoreCSV(java.io.BufferedReader poBufferedReader)
                      throws StorageException
Retrieve one training sample from a CSV file. TODO: BROKEN.

Parameters:
poBufferedReader - BufferedReader
Throws:
StorageException - in case of I/O or otherwise error

getRevision

public static java.lang.String getRevision()
Returns source code revision information.

Returns:
revision string
Since:
0.3.0