LIBSVM bindings for OCaml
Module Libsvm . Svm . Model
type t

Type of a SVM model.

val get_svm_type : t -> [ `C_SVC | `NU_SVC | `ONE_CLASS | `EPSILON_SVR | `NU_SVR ]

get_svm_type model

  • returns

    the svm type that was used to train the given model.

val get_n_classes : t -> int

get_n_classes model

  • returns

    the number of classes for a classification model or 2 for a regression or an one-class model.

val get_labels : t -> int list

get_labels model

  • returns

    the labels of a two or multi-class classification problem in a list.

  • raises Invalid_argument

    in the case of a regression or one-class model.

val get_n_sv : t -> int

get_n_sv model

  • returns

    the total number of support vectors.

val get_svr_probability : t -> float

get_svr_probability model

  • returns

    a positive value for a regression model with probability information. In the case of no probability information, 0 is returned.

  • raises Invalid_argument

    for non-regression models.

val save : t -> string -> unit

save model filename saves a model to the file filename.

val load : string -> t

load filename loads a model from the file filename.

  • raises Failure

    if model could not be loaded.