Cluster
Base template class representing a cluster of data records.Template parameters
Dataset type that defines
record_type memberType definitions
Type of the dataset this cluster operates on
Type of individual records in the dataset
Methods
Sets the cluster identifierParameters:
id(std::size_t): Cluster identifier
Returns the cluster identifierReturns: The cluster’s ID as
std::size_tProtected members
Cluster identifier (default: 0)
Vector of shared pointers to records belonging to this cluster
Example
CenterCluster
Template class representing a cluster with a center point, derived fromCluster.
Template parameters
Dataset type that defines
record_type memberType definitions
Type of the dataset this cluster operates on
Type of individual records in the dataset
Constructors
Default constructor
Constructs a cluster with specified centerParameters:
center(const std::shared_ptr<record_type>&): Shared pointer to the center record
Methods
Returns a const reference to the center pointReturns: Const reference to shared pointer to the center record
Returns a mutable reference to the center pointReturns: Mutable reference to shared pointer to the center record
Protected members
Shared pointer to the cluster’s center point
Example
SubspaceCluster
Template class representing a subspace cluster with weighted dimensions, derived fromCenterCluster.
Template parameters
Dataset type that defines
record_type and value_type membersType definitions
Type of the dataset this cluster operates on
Type of individual records in the dataset
Numeric value type for dimension weights
Constructors
Constructs a subspace cluster with specified centerParameters:
center(const std::shared_ptr<record_type>&): Shared pointer to the center record
Methods
Returns mutable reference to the weight vectorReturns: Mutable reference to dimension weights
Returns const reference to the weight vectorReturns: Const reference to dimension weights
Returns mutable reference to weight at index iParameters:
i(std::size_t): Dimension index
Returns const reference to weight at index iParameters:
i(std::size_t): Dimension index
Protected members
Vector of weights for each dimension in the subspace
Example
Namespace
All cluster classes are defined in themlpp::unsupervised::clustering namespace.