marf.Storage
Class Cluster

java.lang.Object
  extended by marf.Storage.TrainingSample
      extended by marf.Storage.Cluster
All Implemented Interfaces:
java.io.Serializable

public class Cluster
extends TrainingSample

Cluster contains a cluster information per subject.

$Id: Cluster.java,v 1.9 2005/06/16 19:58:54 mokhov Exp $

Since:
0.3.0
Version:
$Revision: 1.9 $
Author:
Serguei Mokhov
See Also:
Serialized Form

Field Summary
 
Fields inherited from class marf.Storage.TrainingSample
adDataVector, iSubjectID, oFilenames
 
Constructor Summary
Cluster()
           
 
Method Summary
 boolean addFeatureVector(double[] padFeatureVector, java.lang.String pstrFilename, int piSubjectID)
          Adds new feature vector to the mean and recomputes the mean.
 boolean addFilename(java.lang.String pstrFilename)
          Adds a filename to the training set.
 boolean existsFilename(java.lang.String pstrFilename)
          Checks existance of the file in the training set.
static java.lang.String getMARFSourceCodeRevision()
          Returns source code revision information.
 int getMeanCount()
          Retrieves current mean count.
 double[] getMeanVector()
          Retrieves the mean vector.
 int incMeanCount()
          Increases mean count by one.
 void setMeanVector(double[] padMeanVector)
          Sets new mean vector.
 
Methods inherited from class marf.Storage.TrainingSample
dumpCSV, getDataVector, getSubjectID, restoreCSV, setDataVector, setFilename, setSubjectID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Cluster

public Cluster()
Method Detail

addFilename

public final boolean addFilename(java.lang.String pstrFilename)
Adds a filename to the training set.

Parameters:
pstrFilename - filename to add
Returns:
false if the filename is already there; true otherwise
See Also:
existsFilename(String)

existsFilename

public final boolean existsFilename(java.lang.String pstrFilename)
Checks existance of the file in the training set. Serves 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

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

setMeanVector

public final void setMeanVector(double[] padMeanVector)
Sets new mean vector.

Parameters:
padMeanVector - double array representing the mean vector

addFeatureVector

public final boolean addFeatureVector(double[] padFeatureVector,
                                      java.lang.String pstrFilename,
                                      int piSubjectID)
Adds new feature vector to the mean and recomputes the mean.

Parameters:
padFeatureVector - vector to add
pstrFilename - filename to add
piSubjectID - for which subject that vector is
Returns:
true if the vector was added; false otherwise

getMARFSourceCodeRevision

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

Returns:
revision string