#include <genesis/utils/math/kmeans.hpp>
template<typename Point>
class genesis::utils::Kmeans< Point >
Definition at line 91 of file utils/math/kmeans.hpp.
|
virtual bool | assign_to_centroids (std::vector< Point > const &data, std::vector< Point > const ¢roids, std::vector< size_t > &assignments) |
|
virtual KmeansClusteringInfo | cluster_info (std::vector< Point > const &data, std::vector< size_t > const &assignments, std::vector< Point > const ¢roids) const |
|
virtual bool | data_validation (std::vector< Point > const &data) const |
|
virtual double | distance (Point const &lhs, Point const &rhs) const =0 |
|
virtual std::pair< size_t, double > | find_nearest_cluster (std::vector< Point > const ¢roids, Point const &datum) const |
|
virtual void | initialize (std::vector< Point > const &data, size_t const k) |
|
virtual bool | lloyd_step (std::vector< Point > const &data, std::vector< size_t > &assignments, std::vector< Point > ¢roids) |
|
virtual void | post_loop_hook (std::vector< Point > const &data, std::vector< size_t > &assignments, std::vector< Point > ¢roids) |
|
virtual void | pre_loop_hook (std::vector< Point > const &data, std::vector< size_t > &assignments, std::vector< Point > ¢roids) |
|
virtual bool | treat_empty_centroids (std::vector< Point > const &data, std::vector< size_t > &assignments, std::vector< Point > ¢roids, std::unordered_set< size_t > const &empty_centroids) |
|
virtual void | update_centroids (std::vector< Point > const &data, std::vector< size_t > const &assignments, std::vector< Point > ¢roids)=0 |
|
◆ Kmeans() [1/3]
◆ ~Kmeans()
◆ Kmeans() [2/3]
◆ Kmeans() [3/3]
◆ assign_to_centroids()
virtual bool assign_to_centroids |
( |
std::vector< Point > const & |
data, |
|
|
std::vector< Point > const & |
centroids, |
|
|
std::vector< size_t > & |
assignments |
|
) |
| |
|
inlineprotectedvirtual |
◆ assignments() [1/2]
std::vector<size_t> const& assignments |
( |
| ) |
const |
|
inline |
◆ assignments() [2/2]
Kmeans& assignments |
( |
std::vector< size_t > const & |
value | ) |
|
|
inline |
◆ centroids() [1/2]
std::vector<Point> const& centroids |
( |
| ) |
const |
|
inline |
◆ centroids() [2/2]
Kmeans& centroids |
( |
std::vector< Point > const & |
value | ) |
|
|
inline |
◆ clear()
◆ cluster_info() [1/2]
◆ cluster_info() [2/2]
virtual KmeansClusteringInfo cluster_info |
( |
std::vector< Point > const & |
data, |
|
|
std::vector< size_t > const & |
assignments, |
|
|
std::vector< Point > const & |
centroids |
|
) |
| const |
|
inlineprotectedvirtual |
◆ cluster_sizes()
std::vector<size_t> cluster_sizes |
( |
| ) |
const |
|
inline |
◆ data_validation()
virtual bool data_validation |
( |
std::vector< Point > const & |
data | ) |
const |
|
inlineprotectedvirtual |
◆ distance()
virtual double distance |
( |
Point const & |
lhs, |
|
|
Point const & |
rhs |
|
) |
| const |
|
protectedpure virtual |
◆ find_nearest_cluster()
virtual std::pair<size_t, double> find_nearest_cluster |
( |
std::vector< Point > const & |
centroids, |
|
|
Point const & |
datum |
|
) |
| const |
|
inlineprotectedvirtual |
◆ initialization_strategy() [1/2]
◆ initialization_strategy() [2/2]
◆ initialize()
virtual void initialize |
( |
std::vector< Point > const & |
data, |
|
|
size_t const |
k |
|
) |
| |
|
inlineprotectedvirtual |
◆ lloyd_step()
virtual bool lloyd_step |
( |
std::vector< Point > const & |
data, |
|
|
std::vector< size_t > & |
assignments, |
|
|
std::vector< Point > & |
centroids |
|
) |
| |
|
inlineprotectedvirtual |
◆ max_iterations() [1/2]
size_t max_iterations |
( |
| ) |
const |
|
inline |
◆ max_iterations() [2/2]
Kmeans& max_iterations |
( |
size_t |
value | ) |
|
|
inline |
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ post_loop_hook()
virtual void post_loop_hook |
( |
std::vector< Point > const & |
data, |
|
|
std::vector< size_t > & |
assignments, |
|
|
std::vector< Point > & |
centroids |
|
) |
| |
|
inlineprotectedvirtual |
◆ pre_loop_hook()
virtual void pre_loop_hook |
( |
std::vector< Point > const & |
data, |
|
|
std::vector< size_t > & |
assignments, |
|
|
std::vector< Point > & |
centroids |
|
) |
| |
|
inlineprotectedvirtual |
◆ run()
size_t run |
( |
std::vector< Point > const & |
data, |
|
|
size_t const |
k |
|
) |
| |
|
inline |
◆ treat_empty_centroids()
virtual bool treat_empty_centroids |
( |
std::vector< Point > const & |
data, |
|
|
std::vector< size_t > & |
assignments, |
|
|
std::vector< Point > & |
centroids, |
|
|
std::unordered_set< size_t > const & |
empty_centroids |
|
) |
| |
|
inlineprotectedvirtual |
◆ update_centroids()
virtual void update_centroids |
( |
std::vector< Point > const & |
data, |
|
|
std::vector< size_t > const & |
assignments, |
|
|
std::vector< Point > & |
centroids |
|
) |
| |
|
protectedpure virtual |
◆ value_type
◆ report_initialization
std::function<void( void )> report_initialization |
◆ report_iteration
std::function<void( size_t i )> report_iteration |
The documentation for this class was generated from the following file: