edu.stanford.nlp.cluster
Class AbstractClusteringMethod

java.lang.Object
  |
  +--edu.stanford.nlp.cluster.AbstractClusteringMethod
All Implemented Interfaces:
ClusteringMethod
Direct Known Subclasses:
HACM, Kmeans, LSSA, PDDP, PLSI, SVD

public abstract class AbstractClusteringMethod
extends Object
implements ClusteringMethod

Abstract implementation of ClusteringMethod. Subclasses must implement cluster() method.


Field Summary
protected  Clusters clusters
          vector of clusters
protected  DataCollection db
          document database
protected  String method
          label for method.
protected  int nc
          number of clusters
protected  int nd
          number of documents
protected  int nt
          number of terms
 
Constructor Summary
AbstractClusteringMethod()
           
 
Method Summary
 SimpleClusters cluster(DataCollection data, int num_clusters, String filename)
          Performs clustering algorithm, and prints clusters to file
 double evaluate(DataCollection data, int num_clusters)
          Performs clustering algorithm and returns the score of the resulting clusters.
 double evaluate(DataCollection data, int num_clusters, String filename)
          Performs clustering algorithm, prints resulting clusters to file, and returns the score of the clusters.
protected  void initialize(DataCollection data)
          sets values for db, nt, nd;
 String toString()
          Returns String representation of Clustering Method, including clusters returned by clustering method
 String toXMLString()
          Returns XML String representation of Clustering Method, including clusters returned by clustering method
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface edu.stanford.nlp.cluster.ClusteringMethod
cluster
 

Field Detail

nc

protected int nc
number of clusters


nt

protected int nt
number of terms


nd

protected int nd
number of documents


db

protected DataCollection db
document database


clusters

protected Clusters clusters
vector of clusters


method

protected String method
label for method.

Constructor Detail

AbstractClusteringMethod

public AbstractClusteringMethod()
Method Detail

initialize

protected void initialize(DataCollection data)
sets values for db, nt, nd;


toXMLString

public String toXMLString()
Description copied from interface: ClusteringMethod
Returns XML String representation of Clustering Method, including clusters returned by clustering method

Specified by:
toXMLString in interface ClusteringMethod

toString

public String toString()
Description copied from interface: ClusteringMethod
Returns String representation of Clustering Method, including clusters returned by clustering method

Specified by:
toString in interface ClusteringMethod
Overrides:
toString in class Object

cluster

public SimpleClusters cluster(DataCollection data,
                              int num_clusters,
                              String filename)
Description copied from interface: ClusteringMethod
Performs clustering algorithm, and prints clusters to file

Specified by:
cluster in interface ClusteringMethod

evaluate

public double evaluate(DataCollection data,
                       int num_clusters)
Description copied from interface: ClusteringMethod
Performs clustering algorithm and returns the score of the resulting clusters.

Specified by:
evaluate in interface ClusteringMethod

evaluate

public double evaluate(DataCollection data,
                       int num_clusters,
                       String filename)
Description copied from interface: ClusteringMethod
Performs clustering algorithm, prints resulting clusters to file, and returns the score of the clusters.

Specified by:
evaluate in interface ClusteringMethod


Stanford NLP Group