FUNCTION REFERENCE
fitrlinear
Fit a regularized linear predictor with an unpenalized bias.
Fit a regularized linear predictor with an unpenalized bias.
Syntax
mdl = fitrlinear(X,Y)Syntax
mdl = fitrlinear(tbl,'response~a+b'); mdl = fitrlinear(tbl,'ResponseVarName')Syntax
mdl = fitrlinear(X,Y,'Learner','leastsquares','Regularization','ridge','Lambda',0.1)Learner accepts svm (default) and leastsquares; Regularization accepts ridge (default) and lasso. Lambda defaults to 1/n and accepts a nonnegative scalar or 'auto'. Least-squares loss is half MSE; svm uses epsilon-insensitive loss with optional Epsilon, default iqr(Y)/13.49 (0.1 for zero IQR). Ridge adds Lambda*sum(Beta.^2)/2; lasso adds Lambda*sum(abs(Beta)). Beta and Bias expose the fitted coefficients.
Example
m=fitrlinear([0;1;2;3],[1;3;4;7],'Lambda',0.1); b=m.Beta; predict(m,[0.5;2.5])Differences from MATLAB: Only scalar Lambda and numeric predictors are supported. Ridge uses augmented pivoted QR; lasso least squares uses coordinate descent. Ridge svm uses linear dual SMO; lasso svm and unregularized svm use a bounded primal-dual solve with explicit convergence failures.
These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.