Module libsvm

This module is a low level wrapper for libsvm.

Types

Tnode = object 
  index*: cint
  value*: cdouble
Tproblem = object 
  L*: cint
  y*: ptr cdouble
  x*: ptr ptr Tnode
Ttype = enum 
  C_SVC, NU_SVC, ONE_CLASS, EPSILON_SVR, NU_SVR
TKernelType = enum 
  LINEAR, POLY, RBF, SIGMOID, PRECOMPUTED
Tparameter = 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
TModel = 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

Consts

LIBSVM_VERSION = 312
svmdll = "libsvm.dll"

Procs

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