Module: Numo::Liblinear
- Defined in:
- ext/numo/liblinear/liblinearext.cpp,
lib/numo/liblinear/version.rb,
ext/numo/liblinear/liblinearext.cpp
Overview
Numo::Liblinear is a binding library for LIBLINEAR that handles dataset with Numo::NArray.
Defined Under Namespace
Modules: SolverType
Constant Summary collapse
- VERSION =
The version of Numo::Liblienar you are using.
'2.3.0'
- LIBLINEAR_VERSION =
The version of LIBLINEAR used in backgroud library.
INT2NUM(LIBLINEAR_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_model(filename) ⇒ Array
Load the parameters and model from a text file with LIBLINEAR 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_model(filename, param, model) ⇒ Boolean
Save the parameters and model as a text file with LIBLINEAR format.
-
.train(x, y, param) ⇒ Hash
Train the 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_model(filename) ⇒ Array
Load the parameters and model from a text file with LIBLINEAR 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 method supports only the logistic regression.
.save_model(filename, param, model) ⇒ Boolean
Save the parameters and model as a text file with LIBLINEAR format. The saved file can be used with the liblinear tools. Note that the save_model saves only the parameters necessary for estimation with the trained model.
.train(x, y, param) ⇒ Hash
Train the model according to the given training data.