com.sun.labs.minion.clustering
Class AbstractClusterer

java.lang.Object
  extended by com.sun.labs.minion.clustering.AbstractClusterer
All Implemented Interfaces:
com.sun.labs.util.props.Component, com.sun.labs.util.props.Configurable
Direct Known Subclasses:
FieldClusterer, HAC, KMeans, MST

public abstract class AbstractClusterer
extends java.lang.Object
implements com.sun.labs.util.props.Configurable

An abstract base class for clustering algorithms.


Field Summary
protected  double[][] clusters
           
protected  DocCache dc
           
protected  ClusterElement[] els
           
protected  java.util.List<ClusterElement> empty
           
protected  FeatureClusterer fc
           
protected  java.util.Map<java.lang.String,java.lang.Integer> features
           
protected  java.lang.String field
           
protected  FeatureSelector fs
           
protected  java.util.List<ClusterElement> ignored
           
protected  int k
           
static java.lang.String logTag
           
protected  int N
           
protected  java.lang.String[] names
           
protected  int nFeat
           
protected static double[] one
           
static java.lang.String PROP_K
           
protected  java.util.Map<java.lang.Integer,java.util.List<java.lang.String>> ptof
           
protected  ResultSetImpl rs
           
protected  java.util.List<ClusterElement> te
           
 
Constructor Summary
AbstractClusterer()
           
 
Method Summary
abstract  void cluster()
           
 java.util.Set<ResultsCluster> getClusters()
           
protected  void getElements()
           
protected  void getElements(FeatureClusterer fc, FeatureSelector fs, int nFeat)
          Gets the elements that are to be clustered from a set of results.
 ClusterElement[] getEls()
           
 void init(java.lang.String field)
           
 void newProperties(com.sun.labs.util.props.PropertySheet ps)
           
 void setData(java.lang.String d)
           
 void setFeatureInfo(FeatureClusterer fc, FeatureSelector fs, int nFeat)
           
 void setK(int k)
           
 void setResults(ResultSet r)
           
 java.lang.String toString(double[] p)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

features

protected java.util.Map<java.lang.String,java.lang.Integer> features

ptof

protected java.util.Map<java.lang.Integer,java.util.List<java.lang.String>> ptof

field

protected java.lang.String field

k

protected int k

N

protected int N

rs

protected ResultSetImpl rs

els

protected ClusterElement[] els

clusters

protected double[][] clusters

names

protected java.lang.String[] names

fc

protected FeatureClusterer fc

fs

protected FeatureSelector fs

nFeat

protected int nFeat

ignored

protected java.util.List<ClusterElement> ignored

empty

protected java.util.List<ClusterElement> empty

te

protected java.util.List<ClusterElement> te

one

protected static double[] one

logTag

public static final java.lang.String logTag
See Also:
Constant Field Values

dc

protected DocCache dc

PROP_K

@ConfigInteger(defaultValue=10)
public static final java.lang.String PROP_K
See Also:
Constant Field Values
Constructor Detail

AbstractClusterer

public AbstractClusterer()
Method Detail

init

public void init(java.lang.String field)
          throws SearchEngineException
Throws:
SearchEngineException

setResults

public void setResults(ResultSet r)

setFeatureInfo

public void setFeatureInfo(FeatureClusterer fc,
                           FeatureSelector fs,
                           int nFeat)

setK

public void setK(int k)

setData

public void setData(java.lang.String d)

getElements

protected void getElements(FeatureClusterer fc,
                           FeatureSelector fs,
                           int nFeat)
                    throws SearchEngineException
Gets the elements that are to be clustered from a set of results. The first step is to select the given number of feature clusters from the result set.

Parameters:
fc - a feature clusterer
fs - a feature selector
nFeat - the number of features to select
Throws:
SearchEngineException

getElements

protected void getElements()
                    throws SearchEngineException
Throws:
SearchEngineException

getClusters

public java.util.Set<ResultsCluster> getClusters()

getEls

public ClusterElement[] getEls()

toString

public java.lang.String toString(double[] p)

cluster

public abstract void cluster()

newProperties

public void newProperties(com.sun.labs.util.props.PropertySheet ps)
                   throws com.sun.labs.util.props.PropertyException
Specified by:
newProperties in interface com.sun.labs.util.props.Configurable
Throws:
com.sun.labs.util.props.PropertyException