FUNCTION REFERENCE

fitclinear

Fit a regularized binary linear classifier.

Fit a regularized binary linear classifier.

Syntax

mdl = fitclinear(X,Y,'Learner','svm','Regularization','ridge','Lambda',lambda,'Solver','lbfgs')

Learner is svm (hinge, default) or logistic; Regularization is ridge (default) or lasso. Lambda defaults to 1/NumObservations. The objective is mean loss plus Lambda/2 times squared coefficient norm (ridge), or Lambda times coefficient L1 norm (lasso). Bias is unpenalized. Beta and Bias expose decision coefficients. Logistic scores are posterior probabilities; SVM scores are [-f f]. Table response-name and additive formula forms are supported.

Example

m=fitclinear([-2;-1;1;2],[1;1;2;2],'Learner','logistic'); [y,s]=predict(m,[-1;1])

Differences from MATLAB: Solver names lbfgs and sparsa select deterministic built-in solvers: SMO for hinge ridge, ADMM for hinge lasso and accelerated proximal gradient for logistic. Nonconvergence and work limits return errors. Lambda is a positive scalar; paths and sparse predictors are unsupported.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.