![]() |
Vulpes
0.1.0
Versatile and parallel compUtational Library for high-order discontinuous Polytopal Element Simulations
|
Base class template for KMeans clustering algorithms. More...
#include <kmeans.hpp>
Public Types | |
| using | LabelType = std::vector<size_t> |
| using | CentersType = Eigen::Matrix<T, Dim, Eigen::Dynamic> |
| using | DataType = Eigen::Map<const CentersType> |
Public Member Functions | |
| KMeansBase (size_t k, size_t max_iter=1e6, T tol=1e-6, size_t seed=0) | |
| KMeansBase () | |
| virtual void | fit ()=0 |
| Runs the KMeans clustering algorithm on the input data. | |
| auto | getIterNum () const |
| const LabelType & | getLabels () const |
| const CentersType & | getCentroids () const |
Protected Attributes | |
| bool | m_fitted |
| size_t | m_n_clusters |
| size_t | m_max_iter |
| T | m_tol |
| size_t | m_seed |
| size_t | m_n_samples |
| size_t | m_n_iter |
| CentersType | m_centroids |
| LabelType | m_labels |
Base class template for KMeans clustering algorithms.
This class defines the shared interface and common attributes for all KMeans-based clustering algorithms, such as KMeansNaive. It provides type definitions, constructors, and accessors for cluster labels, centroids, and algorithm parameters. Derived classes should implement the clustering logic by overriding the pure virtual fit() method.
| T | Floating point type for the input data (e.g., float, double). |
| Dim | Dimensionality of the input data |
| using vulpes::geometry::KMeansBase< T, Dim >::CentersType = Eigen::Matrix<T, Dim, Eigen::Dynamic> |
| using vulpes::geometry::KMeansBase< T, Dim >::DataType = Eigen::Map<const CentersType> |
| using vulpes::geometry::KMeansBase< T, Dim >::LabelType = std::vector<size_t> |
|
inlineexplicit |
|
inline |
|
pure virtual |
Runs the KMeans clustering algorithm on the input data.
This method must be implemented by derived classes. It performs clustering and updates the centroids and labels accordingly.
Implemented in vulpes::geometry::KMeansNaive< T, Dim >.
|
inline |
|
inline |
|
inline |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |