This is the cl-libsvm Reference Manual, version 0.0.7, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Sep 15 04:10:54 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
cl-libsvm
CFFI wrapper for LIBSVM
Gabor Melis
MIT
CFFI wrapper for LIBSVM, the machine learning library
0.0.7
cffi
(system).
trivial-garbage
(system).
libsvm-package.lisp
(file).
libsvm.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
cl-libsvm/libsvm.lisp
libsvm-package.lisp
(file).
cl-libsvm
(system).
check-parameter
(function).
distances-from-hyperplane
(function).
free-translated-object
(method).
get-labels
(function).
initialize-instance
(method).
kernel-type
(function).
libsvm-error
(condition).
load-model
(function).
load-normalizer
(function).
load-problem
(function).
make-normalizer
(function).
make-parameter
(function).
make-problem
(function).
map-normalized-input
(function).
map-problem-input
(function).
model
(class).
model-w2s
(function).
n-classes
(function).
normalizer
(class).
parameter
(reader method).
parameter
(class).
parameter-error
(function).
parameter-error
(condition).
predict
(function).
predict-distances
(function).
predict-probabilities
(function).
predict-values
(function).
print-object
(method).
print-object
(method).
problem
(reader method).
problem
(class).
problem-size
(function).
problem-target
(function).
save-model
(function).
save-normalizer
(function).
save-problem
(function).
sparse-index-error
(condition).
svm-type
(function).
train
(function).
translate-from-foreign
(method).
translate-from-foreign
(method).
translate-from-foreign
(method).
translate-from-foreign
(method).
translate-to-foreign
(method).
translate-to-foreign
(method).
translate-to-foreign
(method).
translate-to-foreign
(method).
translate-to-foreign
(method).
translate-to-foreign
(method).
translate-to-foreign
(method).
translate-to-foreign
(method).
translate-to-foreign
(method).
translate-to-foreign
(method).
translate-to-foreign
(method).
translate-to-foreign
(method).
value-for-subsvm
(function).
%check-parameter
(function).
%destroy-model-v2
(function).
%destroy-model-v3
(function).
%get-labels
(function).
%load-model
(function).
%predict-probability
(function).
%predict-values
(function).
%save-model
(function).
%svm_get_model_w2
(function).
%train
(function).
*libsvm-dir*
(special variable).
*libsvm-lib-dir*
(special variable).
*wrappers*
(special variable).
convert-to-double
(function).
convert-vector
(generic function).
ctype
(reader method).
ctype->wrapper-class
(generic function).
define-slot-reader
(macro).
define-wrapped-pointer
(macro).
destroy-wrapped-pointer
(generic function).
double-vector
(class).
error-code-type
(class).
explanation
(reader method).
foreign-slot-value*
(function).
index
(reader method).
lower
(reader method).
map-input
(function).
map-it
(function).
map-sparse-vector
(function).
mapper-length
(function).
max-index
(reader method).
min-maxes
(reader method).
model-parameter
(function).
model-type
(class).
node-tclass
(class).
parameter-struct-tclass
(class).
parameter-type
(class).
pointer
(reader method).
problem-struct-tclass
(class).
problem-type
(class).
reachable-objects
(generic function).
read-normalizer
(function).
references
(reader method).
(setf references)
(writer method).
sparse-vector
(class).
sparse-vector-vector
(class).
symmetric-upper-half-index
(function).
temporary-sparse-vector
(class).
test
(function).
test-normalizer
(function).
test-predict-probabilities
(function).
test-predict-values
(function).
test-problem
(function).
upper
(reader method).
upper-half-index
(function).
wrap
(generic function).
wrapper
(class).
write-normalizer
(function).
~=
(function).
Packages are listed by definition order.
cl-libsvm
Wrapper for the libsvm support vector machine library.
libsvm
cffi
.
common-lisp
.
check-parameter
(function).
distances-from-hyperplane
(function).
get-labels
(function).
kernel-type
(function).
libsvm-error
(condition).
load-model
(function).
load-normalizer
(function).
load-problem
(function).
make-normalizer
(function).
make-parameter
(function).
make-problem
(function).
map-normalized-input
(function).
map-problem-input
(function).
model
(class).
model-w2s
(function).
n-classes
(function).
normalizer
(class).
parameter
(generic reader).
parameter
(class).
parameter-error
(function).
parameter-error
(condition).
predict
(function).
predict-distances
(function).
predict-probabilities
(function).
predict-values
(function).
problem
(generic reader).
problem
(class).
problem-size
(function).
problem-target
(function).
save-model
(function).
save-normalizer
(function).
save-problem
(function).
sparse-index-error
(condition).
svm-type
(function).
train
(function).
value-for-subsvm
(function).
%check-parameter
(function).
%destroy-model-v2
(function).
%destroy-model-v3
(function).
%get-labels
(function).
%load-model
(function).
%predict-probability
(function).
%predict-values
(function).
%save-model
(function).
%svm_get_model_w2
(function).
%train
(function).
*libsvm-dir*
(special variable).
*libsvm-lib-dir*
(special variable).
*wrappers*
(special variable).
convert-to-double
(function).
convert-vector
(generic function).
ctype
(generic reader).
ctype->wrapper-class
(generic function).
define-slot-reader
(macro).
define-wrapped-pointer
(macro).
destroy-wrapped-pointer
(generic function).
double-vector
(class).
error-code-type
(class).
explanation
(generic reader).
foreign-slot-value*
(function).
index
(generic reader).
lower
(generic reader).
map-input
(function).
map-it
(function).
map-sparse-vector
(function).
mapper-length
(function).
max-index
(generic reader).
min-maxes
(generic reader).
model-parameter
(function).
model-type
(class).
node-tclass
(class).
parameter-struct-tclass
(class).
parameter-type
(class).
pointer
(generic reader).
problem-struct-tclass
(class).
problem-type
(class).
reachable-objects
(generic function).
read-normalizer
(function).
references
(generic reader).
(setf references)
(generic writer).
sparse-vector
(class).
sparse-vector-vector
(class).
symmetric-upper-half-index
(function).
temporary-sparse-vector
(class).
test
(function).
test-normalizer
(function).
test-predict-probabilities
(function).
test-predict-values
(function).
test-problem
(function).
upper
(generic reader).
upper-half-index
(function).
wrap
(generic function).
wrapper
(class).
write-normalizer
(function).
~=
(function).
Definitions are sorted by export status, category, package, and then by lexicographic order.
See if PARAMETER is suitable for PROBLEM. Return T if it is, and NIL and a string explaining why if it is not. If ERRORP and the check fails signal BAD-PARAMETER condition.
Calculate the distances from the decision boundary for each subsvm in a classification class. You may obtain DECISION-VALUES from PREDICT-VALUES and W2S from MODEL-W2S.
Wrapper around svm_get_labels.
Return the value of the KERNEL-TYPE slot of PARAMETER.
Load a model from a file.
Load normalizer from FILENAME that is in the format used by svm-scale.
Read a problem from FILENAME in the LIBSVM/SVMLight format.
Create a normalizer that will translate inputs to the [LOWER,UPPER] range.
Make an object that describes how to TRAIN. Note that the command line svm-train defaults to GAMMA=1/maxindex but in this function it defaults to 0. SVM-TYPE is one of :C-SVC, :NU-SVC, :ONE-CLASS, :EPSILON-SVR, :NU-SVR. KERNEL-TYPE is one of :LINEAR, :POLY, :RBF, :SIGMOID, :PRECOMPUTED. See the LIBSVM documentation for the meaning of the arguments.
Create a problem from TARGET that is a vector of real numbers and INPUTS that is a vector of sparse vectors. A sparse vector has index/value conses as elements, alternatively it may be given as a mapper function that maps to index and value.
Map function over the features in INPUT normalized by NORMALIZER.
Map FUNCTION over the indices and values of the Ith input vector of PROBLEM.
Get the squared norm of the vector of each hyperplane for the binary SVMs. See PREDICT-VALUES. To calculate the distance from the decision boundary, use DISTANCES-FROM-HYPERPLANE.
For a classification model, this function gives the number of classes. For a regression or an one-class model, 2 is returned.
Return the prediction (a double float) for the sparse vector INPUT according to MODEL.
Convenience function on top of PREDICT-DISTANCES and PREDICT-VALUES. W2S may be passed in to save computation.
Return the prediction (a double float) for the sparse vector INPUT according to MODEL. As the second value return a double float vector of probabilities for the labels in the order they appear in GET-LABELS.
Wrapper around svm_predict_values. For a classification model with
nr_class classes, this function gives nr_class*(nr_class-1)/2 decision
values in the array dec_values, where nr_class can be obtained from
the function svm_get_nr_class. The order is label[0] vs. label[1],
..., label[0] vs. label[nr_class-1], label[1] vs. label[2], ...,
label[nr_class-2] vs. label[nr_class-1], where label can be obtained
from the function svm_get_labels.
For a regression model, label[0] is the function value of x calculated using the model. For one-class model, label[0] is +1 or -1.
Return the number of targets in PROBLEM.
Return the Ith target.
Save MODEL to FILENAME.
Save NORMALIZER to FILENAME in the format used by svm-scale.
Save PROBLEM to FILENAME in the LIBSVM/SVMLight format.
Return the value of the SVM-TYPE slot of PARAMETER.
Train and return a model object on PROBLEM according PARAMETER. Signal a PARAMETER-ERROR if PARAMETER is incorrect.
In classification tasks, there is one subsvm for each unordered pair of different labels. Return the value in SEQ pertaining to the subsvm that dicedes between LABEL1 and LABEL2. This is to look up values in the result of PREDICT-VALUES, MODEL-W2S or DISTANCES-FROM-HYPERPLANE.
parameter-error
)) ¶parameter-error
)) ¶temporary-sparse-vector
) param) ¶cffi
.
model-type
)) ¶cffi
.
error-code-type
)) ¶cffi
.
problem-type
)) ¶cffi
.
parameter-type
)) ¶cffi
.
problem
) (ctype problem-type
)) ¶cffi
.
parameter
) (ctype parameter-type
)) ¶cffi
.
model
) (ctype model-type
)) ¶cffi
.
symbol
) (name double-vector
)) ¶cffi
.
function
) (name double-vector
)) ¶cffi
.
vector
) (name double-vector
)) ¶cffi
.
symbol
) (name sparse-vector
)) ¶cffi
.
function
) (name sparse-vector
)) ¶cffi
.
vector
) (name sparse-vector
)) ¶cffi
.
symbol
) (name sparse-vector-vector
)) ¶cffi
.
function
) (name sparse-vector-vector
)) ¶cffi
.
vector
) (name sparse-vector-vector
)) ¶cffi
.
condition
.
:explanation
This slot is read-only.
Normalizers offer basically the same functionality as svm-scale.
An address to wrapper map.
A type safe variant of FOREIGN-SLOT-VALUE that first convert the lisp OBJECT to POINTER-CTYPE and than returns the value of its slot.
Load normalizer from STREAM that is in the format used by svm-scale.
If the upper half of a square matrix of size N is stored in a vector in a quasi row major manner, then return the index into this vector corresponding to the element at ROW and COL. (< ROW COL N) must hold.
Save NORMALIZER to STREAM in the format used by svm-scale.
Return the designator of the class that is to be instantiated when a pointer of CTYPE is being wrapped.
model-type
)) ¶parameter-type
)) ¶problem-type
)) ¶Free foreign resources associated with POINTER of CTYPE.
problem-type
)) ¶parameter-error
)) ¶sparse-index-error
)) ¶normalizer
)) ¶automatically generated reader method
sparse-index-error
)) ¶normalizer
)) ¶automatically generated reader method
Return a list of objects reachable from POINTER of CTYPE. Used to initialize REFERNCES of a wrapper.
normalizer
)) ¶automatically generated reader method
enhanced-foreign-type
.
Initarg | Value |
---|---|
:actual-type | (quote (pointer)) |
enhanced-foreign-type
.
Initarg | Value |
---|---|
:actual-type | (quote (int)) |
A model is what falls out of training and can be used later to make predictions.
enhanced-foreign-type
.
Initarg | Value |
---|---|
:actual-type | (quote (pointer)) |
foreign-struct-type
.
translatable-foreign-type
.
foreign-struct-type
.
translatable-foreign-type
.
A parameter object encapsulates the different kinds
of parameters of SVM. Some of the parameters are specific to a
particular kernel.
enhanced-foreign-type
.
Initarg | Value |
---|---|
:actual-type | (quote (pointer)) |
foreign-struct-type
.
translatable-foreign-type
.
A problem consists of a number of sparse input
vectors and their respective targets. The target is the label of the
class for classification or value for regression.
enhanced-foreign-type
.
Initarg | Value |
---|---|
:actual-type | (quote (pointer)) |
enhanced-foreign-type
.
Initarg | Value |
---|---|
:actual-type | (quote (pointer)) |
enhanced-foreign-type
.
Initarg | Value |
---|---|
:actual-type | (quote (pointer)) |
A foreign pointer that is destroyed when its wrapper is garbage collected.
:pointer
This slot is read-only.
The foreign type of POINTER.
:ctype
This slot is read-only.
A list of lisp objects reachable from POINTER.
:references
Jump to: | %
(
~
C D E F G I K L M N P R S T U V W |
---|
Jump to: | %
(
~
C D E F G I K L M N P R S T U V W |
---|
Jump to: | *
C E I L M P R S U |
---|
Jump to: | *
C E I L M P R S U |
---|
Jump to: | C D E F L M N P S T W |
---|
Jump to: | C D E F L M N P S T W |
---|