Xapian::KMeans Class Reference

Kmeans clusterer: This clusterer implements the K-Means clustering algorithm. More...

`#include <cluster.h>`

Inheritance diagram for Xapian::KMeans:
[legend]

## Public Member Functions

| KMeans (unsigned int k_, unsigned int max_iters_=0)
| Constructor specifying number of clusters and maximum iterations.
ClusterSet | cluster (const MSet &mset) override
| Implements the KMeans clustering algorithm.
void | set_stopper (const Xapian::Stopper *stop=NULL)
| Set the Xapian::Stopper object to be used for identifying stopwords.
std::string | get_description () const override
| Return a string describing this object.
Public Member Functions inherited from Xapian::Clusterer
virtual | ~Clusterer ()
| Destructor.
Clusterer * | release ()
| Start reference counting this object.
const Clusterer * | release () const
| Start reference counting this object.

## Detailed Description

Kmeans clusterer: This clusterer implements the K-Means clustering algorithm.

## Constructor & Destructor Documentation

## KMeans()

Xapian::KMeans::KMeans | ( | unsigned int | k_,
|  | unsigned int | max_iters_ = 0 )

explicit

Constructor specifying number of clusters and maximum iterations.

Parameters

  k_ | Number of required clusters
  max_iters_ | The maximum number of iterations for which KMeans will run if it doesn't converge

## Member Function Documentation

## cluster()

ClusterSet Xapian::KMeans::cluster | ( | const MSet & | mset | ) |

override virtual

Implements the KMeans clustering algorithm.

Parameters

  mset | MSet object containing the documents that are to be clustered

Implements Xapian::Clusterer.

## get_description()

std::string Xapian::KMeans::get_description | ( |  | ) | const

override virtual

Return a string describing this object.

Implements Xapian::Clusterer.

## set_stopper()

void Xapian::KMeans::set_stopper | ( | const Xapian::Stopper * | stop = NULL | ) |

inline

Set the Xapian::Stopper object to be used for identifying stopwords.

Stopwords are discarded while calculating term frequency for terms.

Parameters

  stop | The Stopper object to set (default NULL, which means no stopwords)

The documentation for this class was generated from the following file:

- xapian/cluster.h