#include <Cluster.hpp>
Inheritance diagram for Cluster:

Public Methods | |
| Cluster (int cid, const 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< int > | 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< int > 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 |
| int | size |
| double | weight |
| const Index & | ind |
| fstream * | datFile |
| long | offset |
|
||||||||||||||||
|
create empty cluster with specific id.
|
|
|
delete cluster
|
|
|
Add a list of documents to a cluster.
Reimplemented in CentroidCluster. |
|
|
add the element to this cluster
Reimplemented in CentroidCluster. |
|
|
Get the ClusterRep for this Cluster for scoring. The Rep will have been weighted by the SimilarityMethod. Caller responsible for deleting.
Implemented in AgglomCluster, and 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 CentroidCluster. |
|
|
remove the element from this cluster
Reimplemented in CentroidCluster. |
|
|
score a document against this cluster, given the rep.
Implemented in AgglomCluster, and 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 AgglomCluster, and CentroidCluster. |
|
|
write a cluster to the cluster db file.
|
|
|
|
|
|
internal id
|
|
|
vector of cluster elements in this cluster.
|
|
|
|
|
|
external symbolic name.
|
|
|
|
|
|
|
|
|
|
|
|
|
1.2.18