Module libsvm

This module is a low level wrapper for libsvm.

Types

Tnode* {.pure, final.} = object 
  index*: cint
  value*: cdouble
See source
Tproblem* {.pure, final.} = object 
  L*: cint
  y*: ptr cdouble
  x*: ptr ptr Tnode
See source
Ttype* {.size: sizeof(cint).} = enum 
  C_SVC, NU_SVC, ONE_CLASS, EPSILON_SVR, NU_SVR
See source
TKernelType* {.size: sizeof(cint).} = enum 
  LINEAR, POLY, RBF, SIGMOID, PRECOMPUTED
See source
Tparameter* {.pure, final.} = object 
  typ*: TType
  kernelType*: TKernelType
  degree*: cint
  gamma*: cdouble
  coef0*: cdouble
  cache_size*: cdouble
  eps*: cdouble
  C*: cdouble
  nr_weight*: cint
  weight_label*: ptr cint
  weight*: ptr cdouble
  nu*: cdouble
  p*: cdouble
  shrinking*: cint
  probability*: cint
See source
TModel* {.pure, final.} = object 
  param*: Tparameter
  nr_class*: cint
  L*: cint
  SV*: ptr ptr Tnode
  sv_coef*: ptr ptr cdouble
  rho*: ptr cdouble
  probA*: ptr cdouble
  probB*: ptr cdouble
  label*: ptr cint
  nSV*: ptr cint
  free_sv*: cint
See source

Consts

LIBSVM_VERSION* = 312
See source
svmdll* = "libsvm.dll"
See source

Procs

proc train*(prob: ptr Tproblem; param: ptr Tparameter): ptr Tmodel {.cdecl, 
    importc: "svm_train", dynlib: svmdll.}
See source
proc cross_validation*(prob: ptr Tproblem; param: ptr Tparameter; nr_fold: cint; 
                       target: ptr cdouble) {.cdecl, 
    importc: "svm_cross_validation", dynlib: svmdll.}
See source
proc save_model*(model_file_name: cstring; model: ptr Tmodel): cint {.cdecl, 
    importc: "svm_save_model", dynlib: svmdll.}
See source
proc load_model*(model_file_name: cstring): ptr Tmodel {.cdecl, 
    importc: "svm_load_model", dynlib: svmdll.}
See source
proc get_svm_type*(model: ptr Tmodel): cint {.cdecl, 
    importc: "svm_get_svm_type", dynlib: svmdll.}
See source
proc get_nr_class*(model: ptr Tmodel): cint {.cdecl, 
    importc: "svm_get_nr_class", dynlib: svmdll.}
See source
proc get_labels*(model: ptr Tmodel; label: ptr cint) {.cdecl, 
    importc: "svm_get_labels", dynlib: svmdll.}
See source
proc get_svr_probability*(model: ptr Tmodel): cdouble {.cdecl, 
    importc: "svm_get_svr_probability", dynlib: svmdll.}
See source
proc predict_values*(model: ptr Tmodel; x: ptr Tnode; dec_values: ptr cdouble): cdouble {.
    cdecl, importc: "svm_predict_values", dynlib: svmdll.}
See source
proc predict*(model: ptr Tmodel; x: ptr Tnode): cdouble {.cdecl, 
    importc: "svm_predict", dynlib: svmdll.}
See source
proc predict_probability*(model: ptr Tmodel; x: ptr Tnode; 
                          prob_estimates: ptr cdouble): cdouble {.cdecl, 
    importc: "svm_predict_probability", dynlib: svmdll.}
See source
proc free_model_content*(model_ptr: ptr Tmodel) {.cdecl, 
    importc: "svm_free_model_content", dynlib: svmdll.}
See source
proc free_and_destroy_model*(model_ptr_ptr: ptr ptr Tmodel) {.cdecl, 
    importc: "svm_free_and_destroy_model", dynlib: svmdll.}
See source
proc destroy_param*(param: ptr Tparameter) {.cdecl, 
    importc: "svm_destroy_param", dynlib: svmdll.}
See source
proc check_parameter*(prob: ptr Tproblem; param: ptr Tparameter): cstring {.
    cdecl, importc: "svm_check_parameter", dynlib: svmdll.}
See source
proc check_probability_model*(model: ptr Tmodel): cint {.cdecl, 
    importc: "svm_check_probability_model", dynlib: svmdll.}
See source
proc set_print_string_function*(print_func: proc (arg: cstring) {.cdecl.}) {.
    cdecl, importc: "svm_set_print_string_function", dynlib: svmdll.}
See source
Generated: 2014-04-21 09:48:37 UTC