Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

lemur::cluster::CentroidCluster Class Reference

Centroid clustering of documents (agglomerative mean). Trades space for speed. More...

#include <CentroidCluster.hpp>

Inheritance diagram for lemur::cluster::CentroidCluster:

lemur::cluster::Cluster List of all members.

Public Member Functions

 CentroidCluster (int cid, const lemur::api::Index &ind, const SimilarityMethod &sim)
 initialize

virtual ~CentroidCluster ()
 clean up

virtual double score (const ClusterRep *rep) const
 score a document against this cluster, given the rep.

virtual void add (const ClusterElt &elt)
 add an element

virtual void add (const vector< lemur::api::DOCID_T > docids)
 add a list of document ids

virtual void remove (const ClusterElt &elt)
 remove the element from this cluster

virtual bool read (ifstream &in)
 read a cluster in from the cluster db file.

virtual ClusterRepgetClusterRep () const
 Get the ClusterRep for this Cluster for scoring. The Rep will have been weighted by the SimilarityMethod. Caller responsible for deleting.

virtual double sum2 () const
 Sum of squared values in the cluster's term vector.


Private Member Functions

lemur::utility::FloatFreqVectorreadCentroid ()
 Read the centroid vector of the cluster in from disk.

void updateCentroid (lemur::utility::FloatFreqVector *v, bool first)
 Add a vector to the centroid.


Private Attributes

lemur::utility::FloatFreqVectorcentroid
 The centroid vector of the cluster.

ClusterRepweightedCentroid
 The weighted centroid vector of the cluster as a ClusterRep.


Detailed Description

Centroid clustering of documents (agglomerative mean). Trades space for speed.


Constructor & Destructor Documentation

lemur::cluster::CentroidCluster::CentroidCluster int  cid,
const lemur::api::Index ind,
const SimilarityMethod sim
 

initialize

virtual lemur::cluster::CentroidCluster::~CentroidCluster  )  [inline, virtual]
 

clean up


Member Function Documentation

void lemur::cluster::CentroidCluster::add const vector< lemur::api::DOCID_T docids  )  [virtual]
 

add a list of document ids

Reimplemented from lemur::cluster::Cluster.

void lemur::cluster::CentroidCluster::add const ClusterElt elt  )  [virtual]
 

add an element

Reimplemented from lemur::cluster::Cluster.

lemur::cluster::ClusterRep * lemur::cluster::CentroidCluster::getClusterRep  )  const [virtual]
 

Get the ClusterRep for this Cluster for scoring. The Rep will have been weighted by the SimilarityMethod. Caller responsible for deleting.

Implements lemur::cluster::Cluster.

bool lemur::cluster::CentroidCluster::read ifstream &  in  )  [virtual]
 

read a cluster in from the cluster db file.

Reimplemented from lemur::cluster::Cluster.

lemur::utility::FloatFreqVector * lemur::cluster::CentroidCluster::readCentroid  )  [private]
 

Read the centroid vector of the cluster in from disk.

void lemur::cluster::CentroidCluster::remove const ClusterElt elt  )  [virtual]
 

remove the element from this cluster

Reimplemented from lemur::cluster::Cluster.

double lemur::cluster::CentroidCluster::score const ClusterRep rep  )  const [virtual]
 

score a document against this cluster, given the rep.

Implements lemur::cluster::Cluster.

virtual double lemur::cluster::CentroidCluster::sum2  )  const [inline, virtual]
 

Sum of squared values in the cluster's term vector.

Reimplemented from lemur::cluster::Cluster.

void lemur::cluster::CentroidCluster::updateCentroid lemur::utility::FloatFreqVector v,
bool  first
[private]
 

Add a vector to the centroid.

Parameters:
v the vector to add
first if true, initialize the centroid to v.


Member Data Documentation

lemur::utility::FloatFreqVector* lemur::cluster::CentroidCluster::centroid [private]
 

The centroid vector of the cluster.

ClusterRep* lemur::cluster::CentroidCluster::weightedCentroid [private]
 

The weighted centroid vector of the cluster as a ClusterRep.


The documentation for this class was generated from the following files:
Generated on Tue Jun 15 11:03:05 2010 for Lemur by doxygen 1.3.4