fitcsvm
Fit a binary support vector machine classifier.
📝Syntax
mdl = fitcsvm(X, Y)
mdl = fitcsvm(X, Y, Name, Value)
label = predict(mdl, Xnew)
[label, score] = predict(mdl, Xnew)
📄Description

fitcsvm creates a ClassificationSVM object from numeric predictors X and two-class labels Y.

Name-value arguments include ClassNames, KernelFunction, KernelScale, PolynomialOrder, BoxConstraint, Cost, Standardize, IterationLimit, Tolerance, and PredictorNames. Supported kernels are linear, gaussian, rbf, and polynomial.

💡Examples
X = [0 0; 0 1; 1 0; 1 1; 5 5; 5 6; 6 5; 6 6];
Y = [1; 1; 1; 1; 2; 2; 2; 2];
mdl = fitcsvm(X, Y, 'KernelFunction', 'linear');
[label, score] = predict(mdl, [0.2 0.2; 5.2 5.2])
🔗See Also
fitcknnfitcdiscrfitctree
🕔Version History
Version Description
2.0.0 initial version
Edit this page on GitHub