org.carrot2.filter.trc.carrot.filter.cluster.rough.clustering
Class AbstractKMeansClusterer

java.lang.Object
  extended by org.carrot2.filter.trc.carrot.filter.cluster.rough.clustering.AbstractClusterer
      extended by org.carrot2.filter.trc.carrot.filter.cluster.rough.clustering.AbstractKMeansClusterer
Direct Known Subclasses:
KMeansBaselineClusterer, KMeansClusterer

public abstract class AbstractKMeansClusterer
extends AbstractClusterer


Field Summary
static double CLUSTER_SIMILARITY_THRESHOLD
           
protected  double clusterSimilarityThreshold
          Threshold for similarity above which document is assigned to cluster
protected  IRContext corpus
           
protected  int iteration
           
protected static org.apache.log4j.Logger log
           
static int MAX_ITERATION
           
protected  int maxIteration
           
protected  Similarity metric
           
protected  int noOfInitialClusters
          Number of initial clusters
protected  int nterm
           
protected  double overallChanges
           
protected  Timer timer
           
protected  BitVector unclassifiedObjects
           
 
Fields inherited from class org.carrot2.filter.trc.carrot.filter.cluster.rough.clustering.AbstractClusterer
clusters, objects
 
Constructor Summary
protected AbstractKMeansClusterer(int noOfClusters, IRContext context, Similarity distance)
           
 
Method Summary
protected  double calculateCentroidChange(FeatureVector oldCentroid, FeatureVector newCentroid)
           
protected  void calculateClusterSimilarities(Cluster[] clusters)
          Calculate internal similarity of cluster
protected  Cluster[] createOtherTopicCluster(Cluster[] clusters, Object[] objects)
          Create "other" cluster for unclassified objects
protected  double diff(FeatureVector v1, FeatureVector v2)
           
protected  void findClusterDescriptionUsingPhrases(Cluster[] currentClusters, Clusterable[] objects)
           
protected  void findMostDicriminativeFeatures(Cluster[] currentClusters, Clusterable[] objects)
           
protected  boolean fuzzyEquals(double expected, double value, double delta)
           
protected  Clusterable generateRepresentative(Clusterable clusterable)
           
 BitVector getUnclassifiedObjects()
           
 Cluster[] initialization(Object[] objects)
           
 
Methods inherited from class org.carrot2.filter.trc.carrot.filter.cluster.rough.clustering.AbstractClusterer
clustering, doClustering, getClusters, postProcessing, stopCondition
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

timer

protected final Timer timer

unclassifiedObjects

protected BitVector unclassifiedObjects

noOfInitialClusters

protected int noOfInitialClusters
Number of initial clusters


log

protected static final org.apache.log4j.Logger log

metric

protected Similarity metric

overallChanges

protected double overallChanges

nterm

protected int nterm

maxIteration

protected int maxIteration

iteration

protected int iteration

corpus

protected IRContext corpus

CLUSTER_SIMILARITY_THRESHOLD

public static final double CLUSTER_SIMILARITY_THRESHOLD
See Also:
Constant Field Values

MAX_ITERATION

public static final int MAX_ITERATION
See Also:
Constant Field Values

clusterSimilarityThreshold

protected double clusterSimilarityThreshold
Threshold for similarity above which document is assigned to cluster

Constructor Detail

AbstractKMeansClusterer

protected AbstractKMeansClusterer(int noOfClusters,
                                  IRContext context,
                                  Similarity distance)
Method Detail

calculateClusterSimilarities

protected void calculateClusterSimilarities(Cluster[] clusters)
Calculate internal similarity of cluster

Parameters:
clusters -

initialization

public Cluster[] initialization(Object[] objects)
Specified by:
initialization in class AbstractClusterer

generateRepresentative

protected Clusterable generateRepresentative(Clusterable clusterable)

calculateCentroidChange

protected double calculateCentroidChange(FeatureVector oldCentroid,
                                         FeatureVector newCentroid)

diff

protected double diff(FeatureVector v1,
                      FeatureVector v2)

fuzzyEquals

protected boolean fuzzyEquals(double expected,
                              double value,
                              double delta)

getUnclassifiedObjects

public BitVector getUnclassifiedObjects()

createOtherTopicCluster

protected Cluster[] createOtherTopicCluster(Cluster[] clusters,
                                            Object[] objects)
Create "other" cluster for unclassified objects

Parameters:
objects -
clusters -

findClusterDescriptionUsingPhrases

protected void findClusterDescriptionUsingPhrases(Cluster[] currentClusters,
                                                  Clusterable[] objects)

findMostDicriminativeFeatures

protected void findMostDicriminativeFeatures(Cluster[] currentClusters,
                                             Clusterable[] objects)


Copyright (c) Dawid Weiss, Stanislaw Osinski