A library for working with phylogenetic and population genetic data.
v0.32.0
MassTreeKmeans Class Reference

#include <genesis/tree/mass_tree/kmeans.hpp>

Inherits Kmeans< MassTree >.

Detailed Description

Definition at line 53 of file tree/mass_tree/kmeans.hpp.

Public Member Functions

 MassTreeKmeans ()=default
 
 MassTreeKmeans (MassTreeKmeans &&)=default
 
 MassTreeKmeans (MassTreeKmeans const &)=default
 
virtual ~MassTreeKmeans () override=default
 
size_t accumulate_centroid_masses () const
 
void accumulate_centroid_masses (size_t value)
 
MassTreeKmeansoperator= (MassTreeKmeans &&)=default
 
MassTreeKmeansoperator= (MassTreeKmeans const &)=default
 
- Public Member Functions inherited from Kmeans< MassTree >
 Kmeans ()=default
 
 Kmeans (Kmeans &&)=default
 
 Kmeans (Kmeans const &)=default
 
virtual ~Kmeans ()=default
 
std::vector< size_t > const & assignments () const
 
Kmeansassignments (std::vector< size_t > const &value)
 
std::vector< MassTree > const & centroids () const
 
Kmeanscentroids (std::vector< MassTree > const &value)
 
void clear ()
 
KmeansClusteringInfo cluster_info (std::vector< MassTree > const &data) const
 
std::vector< size_t > cluster_sizes () const
 
KmeansInitializationStrategy initialization_strategy () const
 
Kmeansinitialization_strategy (KmeansInitializationStrategy value)
 
size_t max_iterations () const
 
Kmeansmax_iterations (size_t value)
 
Kmeansoperator= (Kmeans &&)=default
 
Kmeansoperator= (Kmeans const &)=default
 
size_t run (std::vector< MassTree > const &data, size_t const k)
 

Public Types

using Point = MassTree
 
- Public Types inherited from Kmeans< MassTree >
using value_type = MassTree
 

Additional Inherited Members

- Public Attributes inherited from Kmeans< MassTree >
std::function< void(void)> report_initialization
 
std::function< void(size_t i)> report_iteration
 
- Protected Member Functions inherited from Kmeans< MassTree >
virtual bool assign_to_centroids (std::vector< MassTree > const &data, std::vector< MassTree > const &centroids, std::vector< size_t > &assignments)
 
virtual KmeansClusteringInfo cluster_info (std::vector< MassTree > const &data, std::vector< size_t > const &assignments, std::vector< MassTree > const &centroids) const
 
virtual bool data_validation (std::vector< MassTree > const &data) const
 
virtual double distance (MassTree const &lhs, MassTree const &rhs) const=0
 
virtual std::pair< size_t, double > find_nearest_cluster (std::vector< MassTree > const &centroids, MassTree const &datum) const
 
virtual void initialize (std::vector< MassTree > const &data, size_t const k)
 
virtual bool lloyd_step (std::vector< MassTree > const &data, std::vector< size_t > &assignments, std::vector< MassTree > &centroids)
 
virtual void post_loop_hook (std::vector< MassTree > const &data, std::vector< size_t > &assignments, std::vector< MassTree > &centroids)
 
virtual void pre_loop_hook (std::vector< MassTree > const &data, std::vector< size_t > &assignments, std::vector< MassTree > &centroids)
 
virtual bool treat_empty_centroids (std::vector< MassTree > const &data, std::vector< size_t > &assignments, std::vector< MassTree > &centroids, std::unordered_set< size_t > const &empty_centroids)
 
virtual void update_centroids (std::vector< MassTree > const &data, std::vector< size_t > const &assignments, std::vector< MassTree > &centroids)=0
 

Constructor & Destructor Documentation

◆ MassTreeKmeans() [1/3]

MassTreeKmeans ( )
default

◆ ~MassTreeKmeans()

virtual ~MassTreeKmeans ( )
overridevirtualdefault

◆ MassTreeKmeans() [2/3]

MassTreeKmeans ( MassTreeKmeans const &  )
default

◆ MassTreeKmeans() [3/3]

MassTreeKmeans ( MassTreeKmeans &&  )
default

Member Function Documentation

◆ accumulate_centroid_masses() [1/2]

size_t accumulate_centroid_masses ( ) const

Definition at line 54 of file kmeans.cpp.

◆ accumulate_centroid_masses() [2/2]

void accumulate_centroid_masses ( size_t  value)

Definition at line 59 of file kmeans.cpp.

◆ operator=() [1/2]

MassTreeKmeans& operator= ( MassTreeKmeans &&  )
default

◆ operator=() [2/2]

MassTreeKmeans& operator= ( MassTreeKmeans const &  )
default

Member Typedef Documentation

◆ Point

using Point = MassTree

Definition at line 62 of file tree/mass_tree/kmeans.hpp.


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