forked from LibOPF/LibOPF
-
Notifications
You must be signed in to change notification settings - Fork 0
/
libopf_py.pxd
57 lines (46 loc) · 2.27 KB
/
libopf_py.pxd
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
# includes
cdef extern from "graph.h":
cdef enum METRIC:
EUCLIDIAN = 0
LOG_EUCLIDIAN = 1
CHI_SQUARE = 2
MANHATTAN = 3
CANBERRA = 4
SQUARED_CHORD = 5
SQUARED_CHI_SQUARE = 6
BRAY_CURTIS = 7
NO_METRIC = 8
cdef struct opf_graph:
pass
opf_graph * opf_graph_create (int node_n)
void opf_graph_destroy (opf_graph ** sg)
void opf_graph_set_metric (opf_graph *sg,
double (*arc_weight) (double *f1, double *f2, int n),
METRIC m)
bint opf_graph_set_feature (opf_graph *sg, double *feat, int *label, int feat_n)
bint opf_graph_set_precomputed_distance (opf_graph *sg,
double *distance,
int *label)
void opf_graph_pdf_evaluate (opf_graph * sg)
void opf_graph_set_fit_data (opf_graph * sg,
double *path_val,
int *label,
int *ordered_list_of_nodes,
int *position,
double *radius)
void opf_graph_get_fit_data (opf_graph * sg,
double *path_val,
int *label,
int *ordered_list_of_nodes,
int *position,
double *radius,
double *data)
cdef extern from "supervised.h":
void opf_supervised_train (opf_graph * sg)
void opf_supervised_train_iterative (opf_graph *sg, double split)
void opf_supervised_train_agglomerative (opf_graph *sg, double split)
void opf_supervised_classify (opf_graph * sgtrain, double *feat, int sample_n, int *label)
cdef extern from "unsupervised.h":
void opf_best_k_min_cut (opf_graph * sg, int kmin, int kmax)
void opf_unsupervised_clustering (opf_graph * sg)
void opf_unsupervised_knn_classify (opf_graph * sgtrain, double *feat, int sample_n, int *label)