#include <Cluster.hpp>
Inheritance diagram for lemur::cluster::Cluster:
Public Member Functions | |
Cluster (int cid, const lemur::api::Index &ind, const SimilarityMethod &sim) | |
create empty cluster with specific id. | |
virtual | ~Cluster () |
delete cluster | |
void | setId (int cid) |
set cluster id. | |
void | setName (const string &newName) |
set cluster symbolic name. | |
int | getId () const |
get cluster id. | |
const string & | getName () const |
get cluster symbolic name. | |
const vector< ClusterElt > * | getIds () const |
get vector of elements in this cluster. | |
vector< lemur::api::DOCID_T > | getDocIds () const |
get vector of doc ids in this cluster. | |
virtual ClusterRep * | getClusterRep () const =0 |
Get the ClusterRep for this Cluster for scoring. The Rep will have been weighted by the SimilarityMethod. Caller responsible for deleting. | |
virtual double | score (const ClusterRep *rep) const =0 |
score a document against this cluster, given the rep. | |
virtual void | add (const ClusterElt &elt) |
add the element to this cluster | |
virtual void | add (const vector< lemur::api::DOCID_T > docids) |
Add a list of documents to a cluster. | |
virtual void | remove (const ClusterElt &elt) |
remove the element from this cluster | |
virtual vector< Cluster * > | split (int numParts=2) |
Split this cluster into subclusters. | |
virtual void | merge (const Cluster *c) |
merge in a cluster | |
virtual bool | read (ifstream &in) |
read a cluster in from the cluster db file. | |
virtual void | write (ofstream &out) |
write a cluster to the cluster db file. | |
void | print () const |
pretty print to stdout. | |
int | getSize () const |
How many elements. | |
virtual double | sum2 () const |
Sum of squared values in the cluster's term vector. | |
virtual string | getKeyWords (int numTerms=10) const |
Return the top numTerms terms in the cluster (tf.idf scores). | |
Protected Attributes | |
int | id |
internal id | |
string | name |
external symbolic name. | |
vector< ClusterElt > | ids |
vector of cluster elements in this cluster. | |
const SimilarityMethod & | similarity |
The SimilarityMethod to use for weighting. | |
int | size |
size of the cluster | |
double | weight |
const lemur::api::Index & | ind |
fstream * | datFile |
long | offset |
|
create empty cluster with specific id.
|
|
delete cluster
|
|
Add a list of documents to a cluster.
Reimplemented in lemur::cluster::CentroidCluster. |
|
add the element to this cluster
Reimplemented in lemur::cluster::CentroidCluster. |
|
Get the ClusterRep for this Cluster for scoring. The Rep will have been weighted by the SimilarityMethod. Caller responsible for deleting.
Implemented in lemur::cluster::AgglomCluster, and lemur::cluster::CentroidCluster. |
|
get vector of doc ids in this cluster.
|
|
get cluster id.
|
|
get vector of elements in this cluster.
|
|
Return the top numTerms terms in the cluster (tf.idf scores).
|
|
get cluster symbolic name.
|
|
How many elements.
|
|
merge in a cluster
|
|
pretty print to stdout.
|
|
read a cluster in from the cluster db file.
Reimplemented in lemur::cluster::CentroidCluster. |
|
remove the element from this cluster
Reimplemented in lemur::cluster::CentroidCluster. |
|
score a document against this cluster, given the rep.
Implemented in lemur::cluster::AgglomCluster, and lemur::cluster::CentroidCluster. |
|
set cluster id.
|
|
set cluster symbolic name.
|
|
Split this cluster into subclusters.
|
|
Sum of squared values in the cluster's term vector.
Reimplemented in lemur::cluster::AgglomCluster, and lemur::cluster::CentroidCluster. |
|
write a cluster to the cluster db file.
|
|
|
|
internal id
|
|
vector of cluster elements in this cluster.
|
|
|
|
external symbolic name.
|
|
|
|
The SimilarityMethod to use for weighting.
|
|
size of the cluster
|
|
|