Procedures
01 Syntax
02 Methods
| Name | Overloads | Summary |
|---|---|---|
| setRandomSeed | 1 | Set the random seed value which is used by the LibSVM procedure. |
| sigmoid_train | 1 | Platt's binary SVM Probablistic Output: an improvement from Lin et al. |
| multiclass_probability | 1 | Method 2 from the multiclass_prob paper by Wu, Lin, and Weng |
| svm_binary_svc_probability | 1 | Cross-validation decision values for probability estimates |
| svm_svr_probability | 1 | Return parameter of a Laplace distribution |
| svm_group_classes | 1 | group training data of the same class |
| oneClassSvm | 1 | regression or one-class-svm |
| multipleClassification | 1 | classification |
| svm_train | 1 | Train a support vector machine model from the given problem and parameters, this is the entry point of the whole training procedure. |
| svm_cross_validation | 1 | Stratified cross validation |
| svm_get_svm_type | 1 | Gets the svm type of the given model. |
| svm_get_nr_class | 1 | Gets the number of the classes of the given model. |
| svm_get_labels | 1 | Copy the class label values of the given model into the target array. |
| svm_get_sv_indices | 1 | Copy the indices of the support vectors into the target array. |
| svm_get_nr_sv | 1 | Gets the number of the support vectors of the given model. |
| svm_get_svr_probability | 1 | Gets the sigma value of the laplace distribution which was estimated for the support vector regression model. |
| svm_predict_values | 1 | Evaluate the decision function values of the given input sample. |
| svm_predict | 1 | Predict the label or the target value of a single input sample. |
| svm_predict_probability | 1 | Evaluate the class probability distribution of the given input sample. |
| svm_check_parameter | 1 | Validate the training parameters against the given problem before the training procedure starts. |
| svm_check_probability_model | 1 | Check whether the given model contains the information which is required by the probability inference. |
03 Members
Int32)Set the random seed value which is used by the LibSVM procedure.
| Name | Type | Description |
|---|---|---|
seed | Int32 | The random seed value. |
Int32, Double(), ColorClass(), Double())Platt's binary SVM Probablistic Output: an improvement from Lin et al.
| Name | Type | Description |
|---|---|---|
l | Int32 | The number of the decision values. |
dec_values | Double() | The decision value of each training sample. |
labels | ColorClass() | The class label of each training sample. |
probAB | Double() | The output array which will receive the two parameters |
Int32, Double[0:,0:], Double())Method 2 from the multiclass_prob paper by Wu, Lin, and Weng
| Name | Type | Description |
|---|---|---|
k | Int32 | The number of the classes. |
r | Double[0:,0:] | The pairwise probability matrix, in which the element |
p | Double() | The output array which will receive the probability value of each class. |
Cross-validation decision values for probability estimates
| Name | Type | Description |
|---|---|---|
prob | Problem | The training data of the binary sub-problem. |
param | Parameter | The training parameters. |
Cp | Double | The C value of the positive side samples. |
Cn | Double | The C value of the negative side samples. |
probAB | Double() | The output array which will receive the two parameters |
Return parameter of a Laplace distribution
| Name | Type | Description |
|---|---|---|
prob | Problem | The training data of the regression problem. |
param | Parameter | The training parameters. |
The sigma value of the estimated Laplace distribution; a large value is returned when the regression result is not reliable.
group training data of the same class
| Name | Type | Description |
|---|---|---|
prob | Problem | The source training data which will be grouped. |
nr_class_ret | Int32 | The output number of the classes. |
label_ret | Int32() | label name |
start_ret | Int32() | begin of each class |
count_ret | Int32() | #data of classes |
perm | Int32() | indices to the original data, perm, length l, must be allocated before calling this subroutine |
regression or one-class-svm
classification
Train a support vector machine model from the given problem and parameters, this is the entry point of the whole training procedure.
A trained Model object.
Stratified cross validation
| Name | Type | Description |
|---|---|---|
prob | Problem | The training data which will be cross validated. |
param | Parameter | The training parameters. |
nr_fold | Int32 | The number of the folds of the cross validation. |
target | SVMPrediction() | The output array which will receive the prediction result of each sample. |
Gets the svm type of the given model.
| Name | Type | Description |
|---|---|---|
model | Model | The target model. |
A SvmType value.
Gets the number of the classes of the given model.
| Name | Type | Description |
|---|---|---|
model | Model | The target model. |
An Int32 value.
Int32())Copy the class label values of the given model into the target array.
| Name | Type | Description |
|---|---|---|
model | Model | The target model. |
label | Int32() | The output array which will receive the class labels, its length should be equals to Model.numberOfClasses. |
Int32())Copy the indices of the support vectors into the target array.
| Name | Type | Description |
|---|---|---|
model | Model | The target model. |
indices | Int32() | The output array which will receive the support vector indices, its length should be equals to Model.supportVectorCount. |
Gets the number of the support vectors of the given model.
| Name | Type | Description |
|---|---|---|
model | Model | The target model. |
An Int32 value.
Gets the sigma value of the laplace distribution which was estimated for the support vector regression model.
| Name | Type | Description |
|---|---|---|
model | Model | The target model. |
The sigma value; a message will be written to the error console and 0 will be returned when the target model does not contain the information for the SVR probability inference.
Evaluate the decision function values of the given input sample.
| Name | Type | Description |
|---|---|---|
model | Model | The target model. |
x | Node() | The sparse feature vector of the input sample. |
dec_values | Double() | The output array which will receive the pairwise decision values; for the one-class and the regression models its length should be 1, otherwise it should be |
The SVMPrediction result of the given sample.
Predict the label or the target value of a single input sample.
| Name | Type | Description |
|---|---|---|
model | Model | The target model. |
x | Node() | The sparse feature vector of the input sample. |
兼容分类以及打分这两种工作模式
Evaluate the class probability distribution of the given input sample.
| Name | Type | Description |
|---|---|---|
model | Model | The target model, it should be trained with the probability estimation enabled. |
x | Node() | The sparse feature vector of the input sample. |
prob_estimates | Double() | The output array which will receive the probability value of each class, its length should be equals to Model.numberOfClasses. |
The SVMPrediction result of the given sample; when the model does not provide the pairwise probability, this function falls back to the Procedures.svm_predict() function.
Validate the training parameters against the given problem before the training procedure starts.
| Name | Type | Description |
|---|---|---|
prob | Problem | The training data. |
param | Parameter | The training parameters that will be validated. |
An error message which describes the first invalid parameter, or Nothing when all of the parameters are valid.
Check whether the given model contains the information which is required by the probability inference.
| Name | Type | Description |
|---|---|---|
model | Model | The target model. |
1 when the probability information is available, otherwise 0.