sig
module Problem :
sig
type t
val create : x:Lacaml.D.mat -> y:Lacaml.D.vec -> Libsvm.Svm.Problem.t
val create_k : k:Lacaml.D.mat -> y:Lacaml.D.vec -> Libsvm.Svm.Problem.t
val get_n_samples : Libsvm.Svm.Problem.t -> int
val get_n_feats : Libsvm.Svm.Problem.t -> int
val get_targets : Libsvm.Svm.Problem.t -> Lacaml.D.vec
val load : string -> Libsvm.Svm.Problem.t
val output : Libsvm.Svm.Problem.t -> Pervasives.out_channel -> unit
val save : Libsvm.Svm.Problem.t -> string -> unit
val min_max_feats :
Libsvm.Svm.Problem.t ->
[ `Min of Lacaml.D.vec ] * [ `Max of Lacaml.D.vec ]
val scale :
?lower:float ->
?upper:float ->
Libsvm.Svm.Problem.t ->
min_feats:Lacaml.D.vec ->
max_feats:Lacaml.D.vec -> Libsvm.Svm.Problem.t
val print : Libsvm.Svm.Problem.t -> unit
end
module Model :
sig
type t
val get_svm_type :
Libsvm.Svm.Model.t ->
[ `C_SVC | `EPSILON_SVR | `NU_SVC | `NU_SVR | `ONE_CLASS ]
val get_n_classes : Libsvm.Svm.Model.t -> int
val get_labels : Libsvm.Svm.Model.t -> int list
val get_n_sv : Libsvm.Svm.Model.t -> int
val get_svr_probability : Libsvm.Svm.Model.t -> float
val save : Libsvm.Svm.Model.t -> string -> unit
val load : string -> Libsvm.Svm.Model.t
end
val train :
?svm_type:[ `C_SVC | `EPSILON_SVR | `NU_SVC | `NU_SVR | `ONE_CLASS ] ->
?kernel:[ `LINEAR | `POLY | `PRECOMPUTED | `RBF | `SIGMOID ] ->
?degree:int ->
?gamma:float ->
?coef0:float ->
?c:float ->
?nu:float ->
?eps:float ->
?cachesize:float ->
?tol:float ->
?shrinking:[ `off | `on ] ->
?probability:bool ->
?weights:(int * float) list ->
?verbose:bool -> Libsvm.Svm.Problem.t -> Libsvm.Svm.Model.t
val cross_validation :
?svm_type:[ `C_SVC | `EPSILON_SVR | `NU_SVC | `NU_SVR | `ONE_CLASS ] ->
?kernel:[ `LINEAR | `POLY | `PRECOMPUTED | `RBF | `SIGMOID ] ->
?degree:int ->
?gamma:float ->
?coef0:float ->
?c:float ->
?nu:float ->
?eps:float ->
?cachesize:float ->
?tol:float ->
?shrinking:[ `off | `on ] ->
?probability:bool ->
?weights:(int * float) list ->
?verbose:bool -> n_folds:int -> Libsvm.Svm.Problem.t -> Lacaml.D.vec
val predict_one : Libsvm.Svm.Model.t -> x:Lacaml.D.vec -> float
val predict : Libsvm.Svm.Model.t -> x:Lacaml.D.mat -> Lacaml.D.vec
val predict_values :
Libsvm.Svm.Model.t -> x:Lacaml.D.vec -> float array array
val predict_probability :
Libsvm.Svm.Model.t -> x:Lacaml.D.vec -> float * float array
val predict_from_file :
Libsvm.Svm.Model.t ->
string -> [ `Expected of Lacaml.D.vec ] * [ `Predicted of Lacaml.D.vec ]
end