(Removed) Classify using support vector machine (SVM)
svmclassify
has been removed. Use fitcsvm
, ClassificationSVM
, and CompactClassificationSVM
instead. For more information, see Compatibility Considerations.
Group = svmclassify(SVMStruct,Sample)
Group = svmclassify(SVMStruct,Sample,'Showplot',true)
classifies each row of the data in Group
= svmclassify(SVMStruct
,Sample
)Sample
, a matrix of data, using the
information in a support vector machine classifier structure SVMStruct
,
created using the svmtrain
function. Like the training data used to
create SVMStruct
, Sample
is a matrix where each row
corresponds to an observation or replicate, and each column corresponds to a feature or
variable. Therefore, Sample
must have the same number of columns as the
training data. This is because the number of columns defines the number of features.
Group
indicates the group to which each row of Sample
has been assigned.
plots the Group
= svmclassify(SVMStruct
,Sample
,'Showplot
',true)Sample
data in the figure created using the
Showplot
property with the svmtrain
function. This
plot appears only when the data is twodimensional.

Support vector machine classifier structure created using the 

A matrix where each row corresponds to an observation or replicate, and each column
corresponds to a feature or variable. Therefore, 

Describes whether to display a plot of the classification. Displays only for 2D
problems. Follow with a Boolean argument: 

Column vector with the same number of rows as 
The svmclassify
function uses results from
svmtrain
to classify vectors x according to the
following equation:
$$c={\displaystyle \sum _{i}{\alpha}_{i}k({s}_{i},x)+b},$$
where s_{i} are the support vectors, α_{i} are the weights, b is the bias, and k is a kernel function. In the case of a linear kernel, k is the dot product. If c ≥ 0, then x is classified as a member of the first group, otherwise it is classified as a member of the second group.
[1] Kecman, V., Learning and Soft Computing, MIT Press, Cambridge, MA. 2001.
[2] Suykens, J.A.K., Van Gestel, T., De Brabanter, J., De Moor, B., and Vandewalle, J., Least Squares Support Vector Machines, World Scientific, Singapore, 2002.
[3] Scholkopf, B., and Smola, A.J., Learning with Kernels, MIT Press, Cambridge, MA. 2002.
[4] Cristianini, N., and ShaweTaylor, J. (2000). An Introduction
to Support Vector Machines and Other Kernelbased Learning Methods, First Edition
(Cambridge: Cambridge University Press). https://www.supportvector.net/
ClassificationSVM
 CompactClassificationSVM
 fitcsvm
 svmtrain