rb-libsvm 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,101 @@
1
+ #ifndef _LIBSVM_H
2
+ #define _LIBSVM_H
3
+
4
+ #define LIBSVM_VERSION 310
5
+
6
+ #ifdef __cplusplus
7
+ extern "C" {
8
+ #endif
9
+
10
+ extern int libsvm_version;
11
+
12
+ struct svm_node
13
+ {
14
+ int index;
15
+ double value;
16
+ };
17
+
18
+ struct svm_problem
19
+ {
20
+ int l;
21
+ double *y;
22
+ struct svm_node **x;
23
+ };
24
+
25
+ enum { C_SVC, NU_SVC, ONE_CLASS, EPSILON_SVR, NU_SVR }; /* svm_type */
26
+ enum { LINEAR, POLY, RBF, SIGMOID, PRECOMPUTED }; /* kernel_type */
27
+
28
+ struct svm_parameter
29
+ {
30
+ int svm_type;
31
+ int kernel_type;
32
+ int degree; /* for poly */
33
+ double gamma; /* for poly/rbf/sigmoid */
34
+ double coef0; /* for poly/sigmoid */
35
+
36
+ /* these are for training only */
37
+ double cache_size; /* in MB */
38
+ double eps; /* stopping criteria */
39
+ double C; /* for C_SVC, EPSILON_SVR and NU_SVR */
40
+ int nr_weight; /* for C_SVC */
41
+ int *weight_label; /* for C_SVC */
42
+ double* weight; /* for C_SVC */
43
+ double nu; /* for NU_SVC, ONE_CLASS, and NU_SVR */
44
+ double p; /* for EPSILON_SVR */
45
+ int shrinking; /* use the shrinking heuristics */
46
+ int probability; /* do probability estimates */
47
+ };
48
+
49
+ //
50
+ // svm_model
51
+ //
52
+ struct svm_model
53
+ {
54
+ struct svm_parameter param; /* parameter */
55
+ int nr_class; /* number of classes, = 2 in regression/one class svm */
56
+ int l; /* total #SV */
57
+ struct svm_node **SV; /* SVs (SV[l]) */
58
+ double **sv_coef; /* coefficients for SVs in decision functions (sv_coef[k-1][l]) */
59
+ double *rho; /* constants in decision functions (rho[k*(k-1)/2]) */
60
+ double *probA; /* pariwise probability information */
61
+ double *probB;
62
+
63
+ /* for classification only */
64
+
65
+ int *label; /* label of each class (label[k]) */
66
+ int *nSV; /* number of SVs for each class (nSV[k]) */
67
+ /* nSV[0] + nSV[1] + ... + nSV[k-1] = l */
68
+ /* XXX */
69
+ int free_sv; /* 1 if svm_model is created by svm_load_model*/
70
+ /* 0 if svm_model is created by svm_train */
71
+ };
72
+
73
+ struct svm_model *svm_train(const struct svm_problem *prob, const struct svm_parameter *param);
74
+ void svm_cross_validation(const struct svm_problem *prob, const struct svm_parameter *param, int nr_fold, double *target);
75
+
76
+ int svm_save_model(const char *model_file_name, const struct svm_model *model);
77
+ struct svm_model *svm_load_model(const char *model_file_name);
78
+
79
+ int svm_get_svm_type(const struct svm_model *model);
80
+ int svm_get_nr_class(const struct svm_model *model);
81
+ void svm_get_labels(const struct svm_model *model, int *label);
82
+ double svm_get_svr_probability(const struct svm_model *model);
83
+
84
+ double svm_predict_values(const struct svm_model *model, const struct svm_node *x, double* dec_values);
85
+ double svm_predict(const struct svm_model *model, const struct svm_node *x);
86
+ double svm_predict_probability(const struct svm_model *model, const struct svm_node *x, double* prob_estimates);
87
+
88
+ void svm_free_model_content(struct svm_model *model_ptr);
89
+ void svm_free_and_destroy_model(struct svm_model **model_ptr_ptr);
90
+ void svm_destroy_param(struct svm_parameter *param);
91
+
92
+ const char *svm_check_parameter(const struct svm_problem *prob, const struct svm_parameter *param);
93
+ int svm_check_probability_model(const struct svm_model *model);
94
+
95
+ void svm_set_print_string_function(void (*print_func)(const char *));
96
+
97
+ #ifdef __cplusplus
98
+ }
99
+ #endif
100
+
101
+ #endif /* _LIBSVM_H */
@@ -0,0 +1,478 @@
1
+ {
2
+ Ruby::mark_locations_array
3
+ Memcheck:Cond
4
+ fun:mark_locations_array
5
+ }
6
+ {
7
+ Ruby::str_make_independent.leak
8
+ Memcheck:Leak
9
+ fun:malloc
10
+ fun:ruby_xmalloc
11
+ fun:str_make_independent
12
+ }
13
+ {
14
+ Ruby::gc_mark_children.st_lookup.value4
15
+ Memcheck:Value4
16
+ fun:st_lookup
17
+ fun:rb_mark_generic_ivar
18
+ fun:gc_mark_children
19
+ }
20
+ {
21
+ Ruby::env_aset.leak1
22
+ Memcheck:Leak
23
+ fun:realloc
24
+ fun:ruby_xrealloc
25
+ fun:ruby_setenv
26
+ fun:env_aset
27
+ }
28
+ {
29
+ Ruby::env_aset.leak2
30
+ Memcheck:Leak
31
+ fun:malloc
32
+ fun:ruby_xmalloc
33
+ fun:ruby_strdup
34
+ fun:ruby_setenv
35
+ fun:env_aset
36
+ }
37
+ {
38
+ Ruby::str_new.leak
39
+ Memcheck:Leak
40
+ fun:malloc
41
+ fun:ruby_xmalloc
42
+ fun:str_new
43
+ }
44
+ {
45
+ Ruby::gc_mark_children.st_lookup.cond
46
+ Memcheck:Cond
47
+ fun:st_lookup
48
+ fun:rb_mark_generic_ivar
49
+ fun:gc_mark_children
50
+ }
51
+ {
52
+ Ruby::gc_mark.cond
53
+ Memcheck:Cond
54
+ fun:gc_mark
55
+ }
56
+ {
57
+ Ruby::gc_mark.value4
58
+ Memcheck:Value4
59
+ fun:gc_mark
60
+ }
61
+ {
62
+ Ruby::gc_mark.addr4
63
+ Memcheck:Addr4
64
+ fun:gc_mark
65
+ }
66
+ {
67
+ Ruby::gc_mark_children.addr1
68
+ Memcheck:Addr1
69
+ fun:gc_mark_children
70
+ }
71
+ {
72
+ Ruby::gc_mark_children.addr4
73
+ Memcheck:Addr4
74
+ fun:gc_mark_children
75
+ }
76
+ {
77
+ Ruby::gc_mark_children.cond
78
+ Memcheck:Cond
79
+ fun:gc_mark_children
80
+ }
81
+ {
82
+ Ruby::gc_mark_children.value4
83
+ Memcheck:Value4
84
+ fun:gc_mark_children
85
+ }
86
+ {
87
+ Ruby::scope_dup.leak
88
+ Memcheck:Leak
89
+ fun:malloc
90
+ fun:ruby_xmalloc
91
+ fun:scope_dup
92
+ }
93
+ {
94
+ Ruby::pthread.leak
95
+ Memcheck:Leak
96
+ fun:malloc
97
+ fun:rwlock_have_already
98
+ fun:pthread_rwlock_rdlock
99
+ }
100
+ {
101
+ Ruby::str_format.leak
102
+ Memcheck:Leak
103
+ fun:realloc
104
+ fun:ruby_xrealloc
105
+ fun:rb_str_resize
106
+ fun:rb_f_sprintf
107
+ fun:rb_str_format
108
+ fun:call_cfunc
109
+ fun:rb_call0
110
+ fun:rb_call
111
+ fun:rb_eval
112
+ fun:rb_call0
113
+ fun:rb_call
114
+ fun:rb_eval
115
+ }
116
+ {
117
+ Ruby::HashCreate.leak
118
+ Memcheck:Leak
119
+ fun:calloc
120
+ fun:st_init_table_with_size
121
+ fun:st_init_table
122
+ fun:st_init_numtable
123
+ fun:rb_ivar_set
124
+ fun:rb_eval
125
+ fun:rb_call0
126
+ fun:rb_call
127
+ fun:rb_obj_call_init
128
+ fun:rb_class_new_instance
129
+ fun:call_cfunc
130
+ fun:rb_call0
131
+ }
132
+ {
133
+ Ruby::re_compile.leak2
134
+ Memcheck:Leak
135
+ fun:malloc
136
+ fun:ruby_xmalloc
137
+ fun:ruby_re_compile_pattern
138
+ }
139
+ {
140
+ Ruby::rb_intern.leak
141
+ Memcheck:Leak
142
+ fun:malloc
143
+ fun:st_add_direct
144
+ fun:rb_intern
145
+ fun:rb_str_intern
146
+ fun:call_cfunc
147
+ fun:rb_call0
148
+ fun:rb_call
149
+ fun:rb_eval
150
+ fun:rb_eval
151
+ fun:rb_yield_0
152
+ fun:rb_yield
153
+ fun:int_dotimes
154
+ }
155
+ {
156
+ Ruby::copy_node_scope.leak
157
+ Memcheck:Leak
158
+ fun:malloc
159
+ fun:ruby_xmalloc
160
+ fun:copy_node_scope
161
+ fun:rb_eval
162
+ }
163
+ {
164
+ Ruby::eval_str_append.leak
165
+ Memcheck:Leak
166
+ fun:realloc
167
+ fun:ruby_xrealloc
168
+ fun:rb_str_buf_append
169
+ }
170
+ {
171
+ Ruby::ary_new.leak
172
+ Memcheck:Leak
173
+ fun:malloc
174
+ fun:ruby_xmalloc
175
+ fun:ary_new
176
+ }
177
+ {
178
+ Ruby::ary_store.leak
179
+ Memcheck:Leak
180
+ fun:realloc
181
+ fun:ruby_xrealloc
182
+ fun:rb_ary_store
183
+ }
184
+ {
185
+ Ruby::h_new_str.leak
186
+ Memcheck:Leak
187
+ fun:malloc
188
+ fun:ruby_xmalloc
189
+ fun:h_new_str
190
+ }
191
+ {
192
+ Ruby::ary_new.leak
193
+ Memcheck:Leak
194
+ fun:malloc
195
+ fun:ruby_xmalloc
196
+ fun:ary_new
197
+ fun:rb_ary_new
198
+ }
199
+ {
200
+ Ruby::hash_new.leak
201
+ Memcheck:Leak
202
+ fun:calloc
203
+ fun:st_init_table_with_size
204
+ fun:st_init_table
205
+ }
206
+ {
207
+ GLIBC.cond
208
+ Memcheck:Cond
209
+ obj:/lib/ld-2.3.6.so
210
+ }
211
+ {
212
+ GLIBC.value4
213
+ Memcheck:Value4
214
+ obj:/lib/ld-2.3.6.so
215
+ }
216
+ {
217
+ GLIBC.addr4
218
+ Memcheck:Addr4
219
+ obj:/lib/ld-2.3.6.so
220
+ }
221
+ {
222
+ thread_clone
223
+ Memcheck:Param
224
+ clone(child_tidptr)
225
+ fun:clone
226
+ fun:clone
227
+ }
228
+ {
229
+ GLIBC_2::dl_load
230
+ Memcheck:Leak
231
+ fun:malloc
232
+ obj:/lib/ld-2.3.6.so
233
+ obj:/lib/ld-2.3.6.so
234
+ obj:/lib/ld-2.3.6.so
235
+ fun:dl_open_worker
236
+ obj:/lib/ld-2.3.6.so
237
+ fun:_dl_open
238
+ fun:dlopen_doit
239
+ obj:/lib/ld-2.3.6.so
240
+ fun:_dlerror_run
241
+ fun:dlopen@@GLIBC_2.1
242
+ fun:dln_load
243
+ }
244
+ {
245
+ Ruby::rb_load
246
+ Memcheck:Leak
247
+ fun:calloc
248
+ fun:_dlerror_run
249
+ fun:dlopen@@GLIBC_2.1
250
+ fun:dln_load
251
+ fun:rb_require_safe
252
+ fun:rb_f_require
253
+ fun:call_cfunc
254
+ fun:rb_call0
255
+ fun:rb_call
256
+ fun:rb_eval
257
+ fun:rb_eval
258
+ fun:rb_load
259
+ }
260
+ {
261
+ Ruby::rb_f_require
262
+ Memcheck:Leak
263
+ fun:malloc
264
+ fun:add_to_global
265
+ fun:dl_open_worker
266
+ obj:/lib/ld-2.3.6.so
267
+ fun:_dl_open
268
+ fun:dlopen_doit
269
+ obj:/lib/ld-2.3.6.so
270
+ fun:_dlerror_run
271
+ fun:dlopen@@GLIBC_2.1
272
+ fun:dln_load
273
+ fun:rb_require_safe
274
+ fun:rb_f_require
275
+ }
276
+ {
277
+ Ruby::add_heap
278
+ Memcheck:Leak
279
+ fun:malloc
280
+ fun:add_heap
281
+ fun:ruby_init
282
+ fun:main
283
+ }
284
+ {
285
+ Ruby::rb_require_safe
286
+ Memcheck:Leak
287
+ fun:malloc
288
+ obj:/lib/ld-2.3.6.so
289
+ obj:/lib/ld-2.3.6.so
290
+ fun:dl_open_worker
291
+ obj:/lib/ld-2.3.6.so
292
+ fun:_dl_open
293
+ fun:dlopen_doit
294
+ obj:/lib/ld-2.3.6.so
295
+ fun:_dlerror_run
296
+ fun:dlopen@@GLIBC_2.1
297
+ fun:dln_load
298
+ fun:rb_require_safe
299
+ }
300
+ {
301
+ PThread::rb_require_safe
302
+ Memcheck:Leak
303
+ fun:calloc
304
+ fun:pthread_setspecific
305
+ fun:_dlerror_run
306
+ fun:dlopen@@GLIBC_2.1
307
+ fun:dln_load
308
+ fun:rb_require_safe
309
+ fun:rb_f_require
310
+ fun:call_cfunc
311
+ fun:rb_call0
312
+ fun:rb_call
313
+ fun:rb_eval
314
+ fun:rb_eval
315
+ }
316
+ {
317
+ Ruby::rb_f_require
318
+ Memcheck:Leak
319
+ fun:malloc
320
+ obj:/lib/ld-2.3.6.so
321
+ fun:dl_open_worker
322
+ obj:/lib/ld-2.3.6.so
323
+ fun:_dl_open
324
+ fun:dlopen_doit
325
+ obj:/lib/ld-2.3.6.so
326
+ fun:_dlerror_run
327
+ fun:dlopen@@GLIBC_2.1
328
+ fun:dln_load
329
+ fun:rb_require_safe
330
+ fun:rb_f_require
331
+ }
332
+ {
333
+ GLIBC_2::dl_open_worker
334
+ Memcheck:Leak
335
+ fun:malloc
336
+ fun:realloc
337
+ obj:/lib/ld-2.3.6.so
338
+ obj:/lib/ld-2.3.6.so
339
+ obj:/lib/ld-2.3.6.so
340
+ fun:dl_open_worker
341
+ obj:/lib/ld-2.3.6.so
342
+ fun:_dl_open
343
+ fun:dlopen_doit
344
+ obj:/lib/ld-2.3.6.so
345
+ fun:_dlerror_run
346
+ fun:dlopen@@GLIBC_2.1
347
+ }
348
+ {
349
+ Leak6
350
+ Memcheck:Leak
351
+ fun:calloc
352
+ obj:/lib/ld-2.3.6.so
353
+ fun:dl_open_worker
354
+ obj:/lib/ld-2.3.6.so
355
+ fun:_dl_open
356
+ fun:dlopen_doit
357
+ obj:/lib/ld-2.3.6.so
358
+ fun:_dlerror_run
359
+ fun:dlopen@@GLIBC_2.1
360
+ fun:dln_load
361
+ fun:rb_require_safe
362
+ fun:rb_f_require
363
+ }
364
+ {
365
+ Leak7
366
+ Memcheck:Leak
367
+ fun:calloc
368
+ obj:/lib/ld-2.3.6.so
369
+ obj:/lib/ld-2.3.6.so
370
+ obj:/lib/ld-2.3.6.so
371
+ fun:dl_open_worker
372
+ obj:/lib/ld-2.3.6.so
373
+ fun:_dl_open
374
+ fun:dlopen_doit
375
+ obj:/lib/ld-2.3.6.so
376
+ fun:_dlerror_run
377
+ fun:dlopen@@GLIBC_2.1
378
+ fun:dln_load
379
+ }
380
+ {
381
+ Leak8
382
+ Memcheck:Leak
383
+ fun:calloc
384
+ fun:rehash
385
+ fun:st_insert
386
+ }
387
+ {
388
+ Leak9
389
+ Memcheck:Leak
390
+ fun:malloc
391
+ fun:st_init_table_with_size
392
+ fun:st_init_strtable_with_size
393
+ fun:Init_sym
394
+ fun:rb_call_inits
395
+ fun:ruby_init
396
+ fun:main
397
+ }
398
+ {
399
+ Leak10
400
+ Memcheck:Leak
401
+ fun:realloc
402
+ fun:ruby_xrealloc
403
+ fun:rb_str_buf_cat
404
+ fun:rb_str_cat
405
+ fun:rb_str_cat2
406
+ fun:rb_set_class_path
407
+ fun:rb_define_class_under
408
+ fun:Init_Exception
409
+ fun:rb_call_inits
410
+ fun:ruby_init
411
+ fun:main
412
+ }
413
+ {
414
+ Leak11
415
+ Memcheck:Leak
416
+ fun:malloc
417
+ fun:st_add_direct
418
+ fun:rb_intern
419
+ }
420
+ {
421
+ Leak12
422
+ Memcheck:Leak
423
+ fun:malloc
424
+ fun:st_insert
425
+ }
426
+ {
427
+ Leak13
428
+ Memcheck:Leak
429
+ fun:calloc
430
+ fun:st_init_table_with_size
431
+ fun:st_init_table
432
+ fun:st_init_numtable
433
+ fun:Init_var_tables
434
+ fun:rb_call_inits
435
+ fun:ruby_init
436
+ fun:main
437
+ }
438
+ {
439
+ Leak14
440
+ Memcheck:Leak
441
+ fun:malloc
442
+ fun:ruby_xmalloc
443
+ fun:ruby_strdup
444
+ fun:rb_intern
445
+ }
446
+ {
447
+ Leak15
448
+ Memcheck:Leak
449
+ fun:calloc
450
+ fun:_dlerror_run
451
+ fun:dlopen@@GLIBC_2.1
452
+ fun:dln_load
453
+ fun:rb_require_safe
454
+ fun:rb_f_require
455
+ fun:call_cfunc
456
+ fun:rb_call0
457
+ fun:rb_call
458
+ fun:rb_eval
459
+ fun:rb_load
460
+ fun:rb_require_safe
461
+ }
462
+ {
463
+ Leak16
464
+ Memcheck:Leak
465
+ fun:calloc
466
+ fun:pthread_setspecific
467
+ fun:_dlerror_run
468
+ fun:dlopen@@GLIBC_2.1
469
+ fun:dln_load
470
+ fun:rb_require_safe
471
+ fun:rb_f_require
472
+ fun:call_cfunc
473
+ fun:rb_call0
474
+ fun:rb_call
475
+ fun:rb_eval
476
+ fun:rb_load
477
+ }
478
+