-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinitmethods.h
67 lines (56 loc) · 2.38 KB
/
initmethods.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#ifndef BAKAC_INITMETHODS_H
#define BAKAC_INITMETHODS_H
#include "commonmacros.h"
#include <stddef.h>
/**
* Function picks random k points as cluster centers. Called Forgy method.
* [IN] data - data points, from which k points are picked from.
* [IN] n - points count
* [IN] d - dimension count
* [IN] k - cluster count, k centers are returned
* [IN] seed - integer value to be used as seed by pseudo RNG algorithm.
* return - random n points from data as centers
*/
double* random_cluster_init(double* data, size_t n, size_t d, size_t k, unsigned int seed);
/**
* Function picks first n points as cluster centers.
* [IN] data - data points, from which k points are picked from.
* [IN] n - points count
* [IN] d - dimension count
* [IN] k - cluster count, k centers are returned
* return - first n points from data as centers.
*/
double* pick_n_first(double* data, size_t n, size_t d, size_t k);
/**
* Function uses k-means++ initialization method to pick cluster centers.
* [IN] data - data points, from which k points are picked from.
* [IN] n - points count
* [IN] k - cluster count, k centers are returned
* return - k points from data as centers.
*/
double* kmeans_pp(double* data, size_t n, size_t d, size_t k, unsigned int seed, metricType m_metric);
/**
* Function uses furthest_first initialization method to pick cluster centers.
* [IN] data - data points, from which k points are picked from.
* [IN] n - points count
* [IN] k - cluster count, k centers are returned
* return - k points from data as centers.
*/
double* furthest_first(double* data, size_t n, size_t d, size_t k, unsigned int seed, metricType m_metric);
/**
* Function uses random partition initialization method to pick cluster centers.
* [IN] data - data points, from which k centers are picked from.
* [IN] n - points count
* [IN] k - cluster count, k centers are returned
* return - k points from data as centers.
*/
double* random_partition(double* data, size_t n, size_t d, size_t k, unsigned int seed);
/**
* Function uses uniform initialization method in order to pick cluster centers.
* [IN] data - data points, from which k centers are picked from.
* [IN] n - points count
* [IN] k - cluster count, k centers are returned
* return - k points from data as centers.
*/
double* uniform_init(double* data, size_t n, size_t d, size_t k, unsigned int seed);
#endif //BAKAC_INITMETHODS_H