17#ifndef IGNITION_MATH_KMEANS_HH_
18#define IGNITION_MATH_KMEANS_HH_
23#include <ignition/math/config.hh>
29 inline namespace IGNITION_MATH_VERSION_NAMESPACE
43 public:
explicit Kmeans(
const std::vector<Vector3d> &_obs);
74 std::vector<Vector3d> &_centroids,
75 std::vector<unsigned int> &_labels);
80 private:
unsigned int ClosestCentroid(
const Vector3d &_p)
const;
83 private: KmeansPrivate *dataPtr;
K-Means clustering algorithm.
Definition Kmeans.hh:40
virtual ~Kmeans()
Destructor.
std::vector< Vector3d > Observations() const
Get the observations to cluster.
Kmeans(const std::vector< Vector3d > &_obs)
constructor
bool Observations(const std::vector< Vector3d > &_obs)
Set the observations to cluster.
bool AppendObservations(const std::vector< Vector3d > &_obs)
Add observations to the cluster.
bool Cluster(int _k, std::vector< Vector3d > &_centroids, std::vector< unsigned int > &_labels)
Executes the k-means algorithm.
The Vector3 class represents the generic vector containing 3 elements.
Definition Vector3.hh:40