edu.georgetown.gucs.clustering
Class ClusterPruner

java.lang.Object
  extended by edu.georgetown.gucs.clustering.ClusterPruner

public class ClusterPruner
extends java.lang.Object

Cluster pruner.

Version:
$Revision$, $Date$
Author:
Mark Maloof (maloof@cs.georgetown.edu)

Field Summary
protected  CosineSimilarityFingerprintMatcher distanceFunction
          the distance function used.
 
Constructor Summary
ClusterPruner()
          Default constructor.
 
Method Summary
 void buildClusterer(byte[][] instances)
          Builds this leader clusterer using the specified instances.
 int clusterInstance(byte[] instance)
          Clusters the specified instance.
 int[] getAssignments()
           
 int getK()
           
 int getNumberOfFollowers()
           
 int getNumClusters()
          Gets the number of clusters
static void main(java.lang.String[] args)
          Main method for testing this class.
 int numberOfClusters()
          Returns the number of clusters.
 void setK(int k)
           
 void setPreserveInstancesOrder(boolean r)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

distanceFunction

protected CosineSimilarityFingerprintMatcher distanceFunction
the distance function used.

Constructor Detail

ClusterPruner

public ClusterPruner()
Default constructor.

Method Detail

buildClusterer

public void buildClusterer(byte[][] instances)
                    throws java.lang.Exception
Builds this leader clusterer using the specified instances.

Parameters:
instances - the instances to cluster
Throws:
java.lang.Exception - if the clusterer has not been generated successfully

clusterInstance

public int clusterInstance(byte[] instance)
                    throws java.lang.Exception
Clusters the specified instance.

Parameters:
instance - the instance to be assigned to a cluster
Returns:
the number of the assigned cluster as an integer if the class is enumerated, otherwise the predicted value
Throws:
java.lang.Exception - if instance could not be clustered

numberOfClusters

public int numberOfClusters()
                     throws java.lang.Exception
Returns the number of clusters.

Returns:
the number of clusters generated for a training dataset.
Throws:
java.lang.Exception - if number of clusters could not be returned successfully

getNumClusters

public int getNumClusters()
Gets the number of clusters

Returns:
the number of clusters

getNumberOfFollowers

public int getNumberOfFollowers()

setK

public void setK(int k)
          throws java.lang.Exception
Throws:
java.lang.Exception

getK

public int getK()

setPreserveInstancesOrder

public void setPreserveInstancesOrder(boolean r)

getAssignments

public int[] getAssignments()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

main

public static void main(java.lang.String[] args)
Main method for testing this class.

Parameters:
args - should contain the following arguments:

-t training file [-N number of clusters]