marf.Storage
Class TrainingSet.TrainingSample

java.lang.Object
  |
  +--marf.Storage.TrainingSet.TrainingSample
All Implemented Interfaces:
java.io.Serializable
Enclosing class:
TrainingSet

public class TrainingSet.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.

See Also:
Serialized Form

Constructor Summary
TrainingSet.TrainingSample()
           
 
Method Summary
 boolean addFilename(java.lang.String pstrFilename)
          A filename to the training set.
 void dump(java.io.BufferedWriter bw)
          Write one training sample to a text file.
 boolean existsFilename(java.lang.String pstrFilename)
          Check existance of the file in the training set.
 int getMeanCount()
          Retrieves current mean count
 double[] getMeanVector()
          Retrieves the mean vector
 int getSubjectID()
          Retrieves Subject ID of a particular training sample
 int incMeanCount()
          Increases mean count by one
 void restore(java.io.BufferedReader br)
          Retrieve one training sample from a text file.
 void setMeanVector(double[] padMeanVector)
          Sets new mean vector
 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
 

Constructor Detail

TrainingSet.TrainingSample

public TrainingSet.TrainingSample()
Method Detail

addFilename

public final boolean addFilename(java.lang.String pstrFilename)
A filename to the training set.
Parameters:
pstrFilename - filename to check
Returns:
true if the filename is there; false if not
See Also:
existsFilename

existsFilename

public final boolean existsFilename(java.lang.String pstrFilename)
Check existance of the file in the training set. Servers as an indication that we already trained on the given file.
Parameters:
pstrFilename - filename to check
Returns:
true if the filename is there; false if not

getSubjectID

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

getMeanCount

public final int getMeanCount()
Retrieves current mean count
Returns:
mean count

incMeanCount

public final int incMeanCount()
Increases mean count by one
Returns:
new mean count

getMeanVector

public final double[] getMeanVector()
Retrieves the mean vector
Returns:
array of doubles representing the mean for that cluster

setSubjectID

public final void setSubjectID(int piSubjectID)
Sets new Subject ID
Parameters:
piSubjectID - integer ID

setMeanVector

public final void setMeanVector(double[] padMeanVector)
Sets new mean vector
Parameters:
padMeanVector - double array representing the mean vector

dump

public final void dump(java.io.BufferedWriter bw)
                throws java.io.IOException
Write one training sample to a text file.
Parameters:
bw - BufferedWriter

restore

public final void restore(java.io.BufferedReader br)
                   throws java.io.IOException
Retrieve one training sample from a text file.
Parameters:
br - BufferedReader
Throws:
java.io.IOException -