OpenNN
Open-source neural networks library
Loading...
Searching...
No Matches
kmeans.h
Go to the documentation of this file.
1// OpenNN: Open Neural Networks Library
2// www.opennn.net
3//
4// K - M E A N S H E A D E R
5//
6// Artificial Intelligence Techniques SL
7// artelnics@artelnics.com
8
9#pragma once
10
11#include "tensor_utilities.h"
12
13namespace opennn
14{
15
16class KMeans
17{
18
19public:
20
21 KMeans(Index clusters = 3, Index = 100);
22
24 VectorR elbow_method(const MatrixR&, Index = 10);
25 Index find_optimal_clusters(const VectorR&) const;
26
29 Index get_clusters_number() const;
30
31 void fit(const MatrixR&);
32 void set_cluster_number(const Index);
34
35private:
36
37 Index clusters_number;
38 Index maximum_iterations;
39 //string metric;
40
41 MatrixR cluster_centers;
42 VectorI rows_cluster_labels;
43};
44
45}
46
47// OpenNN: Open Neural Networks Library.
48// Copyright(C) 2005-2026 Artificial Intelligence Techniques, SL.
49// Licensed under the GNU Lesser General Public License v2.1 or later.
Index find_optimal_clusters(const VectorR &) const
VectorR elbow_method(const MatrixR &, Index=10)
void set_centers_random(const MatrixR &)
void fit(const MatrixR &)
KMeans(Index clusters=3, Index=100)
MatrixR get_cluster_centers() const
VectorI get_cluster_labels() const
Index get_clusters_number() const
void set_cluster_number(const Index)
VectorI calculate_outputs(const MatrixR &)
Definition adaptive_moment_estimation.h:19
Matrix< float, Dynamic, Dynamic, Layout > MatrixR
Definition neural_network.h:152
Matrix< Index, Dynamic, 1 > VectorI
Definition neural_network.h:157
Matrix< float, Dynamic, 1 > VectorR
Definition neural_network.h:156