libmf 0.1.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
data/vendor/libmf/mf.def DELETED
@@ -1,21 +0,0 @@
1
- LIBRARY mf
2
- EXPORTS
3
- mf_get_default_param @1
4
- read_problem @2
5
- mf_save_model @3
6
- mf_load_model @4
7
- mf_destroy_model @5
8
- mf_train @6
9
- mf_train_on_disk @7
10
- mf_train_with_validation @8
11
- mf_train_with_validation_on_disk @9
12
- mf_cross_validation @10
13
- mf_cross_validation_on_disk @11
14
- mf_predict @12
15
- calc_rmse @13
16
- calc_mae @14
17
- calc_gkl @15
18
- calc_logloss @16
19
- calc_accuracy @17
20
- calc_mpr @18
21
- calc_auc @19
data/vendor/libmf/mf.h DELETED
@@ -1,130 +0,0 @@
1
- #ifndef _LIBMF_H
2
- #define _LIBMF_H
3
-
4
- #include <string>
5
- #include <utility>
6
-
7
- #ifdef __cplusplus
8
- extern "C"
9
- {
10
-
11
- namespace mf
12
- {
13
- #endif
14
-
15
- typedef float mf_float;
16
- typedef double mf_double;
17
- typedef int mf_int;
18
- typedef long long mf_long;
19
-
20
- enum {P_L2_MFR=0, P_L1_MFR=1, P_KL_MFR=2, P_LR_MFC=5, P_L2_MFC=6, P_L1_MFC=7,
21
- P_ROW_BPR_MFOC=10, P_COL_BPR_MFOC=11, P_L2_MFOC=12};
22
- enum {RMSE=0, MAE=1, GKL=2, LOGLOSS=5, ACC=6, ROW_MPR=10, COL_MPR=11,
23
- ROW_AUC=12, COL_AUC=13};
24
-
25
- struct mf_node
26
- {
27
- mf_int u;
28
- mf_int v;
29
- mf_float r;
30
- };
31
-
32
- struct mf_problem
33
- {
34
- mf_int m;
35
- mf_int n;
36
- mf_long nnz;
37
- struct mf_node *R;
38
- };
39
-
40
- struct mf_parameter
41
- {
42
- mf_int fun;
43
- mf_int k;
44
- mf_int nr_threads;
45
- mf_int nr_bins;
46
- mf_int nr_iters;
47
- mf_float lambda_p1;
48
- mf_float lambda_p2;
49
- mf_float lambda_q1;
50
- mf_float lambda_q2;
51
- mf_float eta;
52
- mf_float alpha;
53
- mf_float c;
54
- bool do_nmf;
55
- bool quiet;
56
- bool copy_data;
57
- };
58
-
59
- struct mf_parameter mf_get_default_param();
60
-
61
- struct mf_model
62
- {
63
- mf_int fun;
64
- mf_int m;
65
- mf_int n;
66
- mf_int k;
67
- mf_float b;
68
- mf_float *P;
69
- mf_float *Q;
70
- };
71
-
72
- mf_problem read_problem(std::string path);
73
-
74
- mf_int mf_save_model(struct mf_model const *model, char const *path);
75
-
76
- struct mf_model* mf_load_model(char const *path);
77
-
78
- void mf_destroy_model(struct mf_model **model);
79
-
80
- struct mf_model* mf_train(
81
- struct mf_problem const *prob,
82
- struct mf_parameter param);
83
-
84
- struct mf_model* mf_train_on_disk(
85
- char const *tr_path,
86
- struct mf_parameter param);
87
-
88
- struct mf_model* mf_train_with_validation(
89
- struct mf_problem const *tr,
90
- struct mf_problem const *va,
91
- struct mf_parameter param);
92
-
93
- struct mf_model* mf_train_with_validation_on_disk(
94
- char const *tr_path,
95
- char const *va_path,
96
- struct mf_parameter param);
97
-
98
- mf_double mf_cross_validation(
99
- struct mf_problem const *prob,
100
- mf_int nr_folds,
101
- struct mf_parameter param);
102
-
103
- mf_double mf_cross_validation_on_disk(
104
- char const *prob,
105
- mf_int nr_folds,
106
- mf_parameter param);
107
-
108
- mf_float mf_predict(struct mf_model const *model, mf_int u, mf_int v);
109
-
110
- mf_double calc_rmse(mf_problem *prob, mf_model *model);
111
-
112
- mf_double calc_mae(mf_problem *prob, mf_model *model);
113
-
114
- mf_double calc_gkl(mf_problem *prob, mf_model *model);
115
-
116
- mf_double calc_logloss(mf_problem *prob, mf_model *model);
117
-
118
- mf_double calc_accuracy(mf_problem *prob, mf_model *model);
119
-
120
- mf_double calc_mpr(mf_problem *prob, mf_model *model, bool transpose);
121
-
122
- mf_double calc_auc(mf_problem *prob, mf_model *model, bool transpose);
123
-
124
- #ifdef __cplusplus
125
- } // namespace mf
126
-
127
- } // extern "C"
128
- #endif
129
-
130
- #endif // _LIBMF_H
Binary file
Binary file
Binary file