com.sun.labs.minion.classification
Class SimpleClusterer

java.lang.Object
  extended by com.sun.labs.minion.classification.SimpleClusterer
All Implemented Interfaces:
FeatureClusterer

public class SimpleClusterer
extends java.lang.Object
implements FeatureClusterer


Constructor Summary
SimpleClusterer()
          Creates a SimpleClusterer
 
Method Summary
 FeatureClusterSet cluster(ResultSetImpl s)
          Clusters features with the same name, adding the weights.
protected  java.util.Set<WeightedFeature> collectFeatures(ArrayGroup ag)
          Collects terms from the array group, creating contingency features for each one.
 FeatureCluster newCluster()
          A non-static factory method to create a feature cluster
 Feature newFeature()
          A non-static factory method to create a feature of the type used by this clusterer
 FeatureClusterer newInstance()
          A non-static factory method to create a feature clusterer
 void setDocCache(DocCache dc)
          Sets the cache of document vectors that we can use to fetch the words in a given document.
 void setField(java.lang.String field)
          Sets the field from which features should be drawn.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleClusterer

public SimpleClusterer()
Creates a SimpleClusterer

Method Detail

newInstance

public FeatureClusterer newInstance()
Description copied from interface: FeatureClusterer
A non-static factory method to create a feature clusterer

Specified by:
newInstance in interface FeatureClusterer
Returns:
a feature clusterer instance

newCluster

public FeatureCluster newCluster()
Description copied from interface: FeatureClusterer
A non-static factory method to create a feature cluster

Specified by:
newCluster in interface FeatureClusterer
Returns:
a feature cluster instance

newFeature

public Feature newFeature()
Description copied from interface: FeatureClusterer
A non-static factory method to create a feature of the type used by this clusterer

Specified by:
newFeature in interface FeatureClusterer
Returns:
a feature instance

setField

public void setField(java.lang.String field)
Description copied from interface: FeatureClusterer
Sets the field from which features should be drawn.

Specified by:
setField in interface FeatureClusterer
Parameters:
field - the name of a vectored field upon which the clustering should be based. A value of null indicates that all vectored fields should be considered, while an empty string indicates that data in no explicit field should be considered.

setDocCache

public void setDocCache(DocCache dc)
Description copied from interface: FeatureClusterer
Sets the cache of document vectors that we can use to fetch the words in a given document.

Specified by:
setDocCache in interface FeatureClusterer

cluster

public FeatureClusterSet cluster(ResultSetImpl s)
Clusters features with the same name, adding the weights.

Specified by:
cluster in interface FeatureClusterer
Parameters:
s - the set of documents from which features are gathered
Returns:
a set of clusters (Features) of features

collectFeatures

protected java.util.Set<WeightedFeature> collectFeatures(ArrayGroup ag)
Collects terms from the array group, creating contingency features for each one.

Parameters:
ag - the array group
Returns:
a set of contingency features