Module: Numo::Libsvm
- Defined in:
- ext/numo/libsvm/libsvmext.cpp,
lib/numo/libsvm/version.rb,
ext/numo/libsvm/libsvmext.cpp
Overview
Numo::Libsvm is a binding library for LIBSVM that handles dataset with Numo::NArray.
Defined Under Namespace
Modules: KernelType, SvmType
Constant Summary collapse
- VERSION =
The version of Numo::Libsvm you are using.
'2.2.0'
- LIBSVM_VERSION =
The version of LIBSVM used in backgroud library.
INT2NUM(LIBSVM_VERSION)
Class Method Summary collapse
-
.cv(x, y, param, n_folds) ⇒ Numo::DFloat
Perform cross validation under given parameters.
-
.decision_function(x, param, model) ⇒ Numo::DFloat
Calculate decision values for given samples.
-
.load_svm_model(filename) ⇒ Array
Load the SVM parameters and model from a text file with LIBSVM format.
-
.predict(x, param, model) ⇒ Numo::DFloat
Predict class labels or values for given samples.
-
.predict_proba(x, param, model) ⇒ Numo::DFloat
Predict class probability for given samples.
-
.save_svm_model(filename, param, model) ⇒ Boolean
Save the SVM parameters and model as a text file with LIBSVM format.
-
.train(x, y, param) ⇒ Hash
Train the SVM model according to the given training data.
Class Method Details
.cv(x, y, param, n_folds) ⇒ Numo::DFloat
Perform cross validation under given parameters. The given samples are separated to n_fols folds. The predicted labels or values in the validation process are returned.
.decision_function(x, param, model) ⇒ Numo::DFloat
Calculate decision values for given samples.
.load_svm_model(filename) ⇒ Array
Load the SVM parameters and model from a text file with LIBSVM format.
.predict(x, param, model) ⇒ Numo::DFloat
Predict class labels or values for given samples.
.predict_proba(x, param, model) ⇒ Numo::DFloat
Predict class probability for given samples. The model must have probability information calcualted in training procedure. The parameter ‘:probability’ set to 1 in training procedure.
.save_svm_model(filename, param, model) ⇒ Boolean
Save the SVM parameters and model as a text file with LIBSVM format. The saved file can be used with the libsvm tools. Note that the svm_save_model saves only the parameters necessary for estimation with the trained model.
.train(x, y, param) ⇒ Hash
Train the SVM model according to the given training data.