CompactClassificationSVM
A CompactClassificationSVM
object is a compact version of a support
vectors machine model, CompactClassificationSVM
.
The CompactClassificationSVM
does not include the training data
resulting to a smaller classifier size, which can be used for making
predictions from new data, but not for tasks such as cross validation. It
can only be created from a ClassificationSVM
model by using the
compact
object method.
The available methods for a CompactClassificationSVM
object
are:
predict
loss
margin
savemodel
See also: fitcsvm, ClassificationSVM
Source Code: CompactClassificationSVM
loss
Determine the classification error for a Support Vector Machine classifier.
L = loss (obj, X, Y)
returns the
predictive accuracy of support vector machine (SVM) classification models.
Comparing the same type of loss across multiple models allows you to
identify which model is more accurate, with a lower loss indicating
superior predictive performance. It supports only binary classifier
models.
CompactClassificationSVM
object.
L = loss (…, Name, Value)
returns the
aforementioned results with additional properties specified by
Name-Value
pair arguments listed below.
Name | Value | |
---|---|---|
"LossFun" | Loss function, specified as a built-in
loss function name. It accepts the following options: (Default is
’classiferror’)
| |
"Weights" | Specified as a numeric vector which weighs each observation (row) in X. The size of Weights must be equal to the number of rows in X. The default value is: ones(size(X,1),1) |
See also: fitcsvm, ClassificationSVM
margin
Determine the classification margins for a Support Vector Machine classification object.
m = margin (obj, X, Y)
returns the
classification margins for the trained support vector machine (SVM)
classifier obj using the sample data in X and the class
labels in Y. It supports only binary classifier models. The
classification margin is commonly defined as m = yf(x),
where f(x) is the classification score and y is the true
class label corresponding to x. A greater margin indicates a better
model.
CompactClassificationSVM
object.
See also: fitcsvm, CompactClassificationSVM
predict
Classify new data points into categories using the Support Vector Machine classification object.
labels = predict (obj, XC)
returns the vector of
labels predicted for the corresponding instances in XC, using the
trained Support Vector Machine classification compact model, obj.
For one-class SVM model, +1 or -1 is returned.
CompactClassificationSVM
class object.
[labels, scores] = predict (obj, XC
also
returns scores, which contains the desicion values for each each
prediction. Alternatively, scores can contain the posterior
probabilities if the ScoreTransform has been previously set using the
fitPosterior
method.
See also: fitcsvm, ClassificationSVM.fitPosterior
savemodel
Save a CompactClassificationSVM object.
savemodel (obj, filename)
saves a
CompactClassificationSVM object into a file defined by filename.
See also: loadmodel, fitcsvm, ClassificationSVM, CompactClassificationSVM