| Contents | Index |
ax = lassoPlot(B)
ax = lassoPlot(B,FitInfo)
ax = lassoPlot(B,FitInfo,Name,Value)
[ax,figh]
= lassoPlot(B,...)
ax = lassoPlot(B) creates a trace plot of the values in B against the L1 norm of B. ax is a handle to the plot axis.
ax = lassoPlot(B,FitInfo) creates a plot with type depending on the data type of FitInfo and the value, if any, of the plotType name-value pair.
ax = lassoPlot(B,FitInfo,Name,Value) creates a plot with additional options specified by one or more Name,Value pair arguments.
[ax,figh] = lassoPlot(B,...) returns a handle to the figure window.
B |
Coefficients of a sequence of regression fits, as returned from the lasso or lassoglm functions. B is a p-by-NLambda matrix, where p is the number of predictors, and each column of B is a set of coefficients lasso calculates using one Lambda penalty value. |
FitInfo |
Information controlling the plot: |
Specify optional comma-separated pairs of Name,Value arguments, where Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.
ax |
Handle to the axis of the plot (see Setting Axis Parameters). |
figh |
Handle to the figure window (see Graphics Windows — the Figure). |
Fit a regularized model of the acetylene data with lasso, and plot the fits with the default plot type:
load acetylene X = [x1 x2 x3]; D = x2fx(X,'interaction'); D(:,1) = []; % No constant term B = lasso(D,y); lassoPlot(B);

Fit a regularized model of the acetylene data with lasso, and plot the fits with the Lambda plot type and logarithmic scaling:
load acetylene X = [x1 x2 x3]; D = x2fx(X,'interaction'); D(:,1) = []; % No constant term [B FitInfo] = lasso(D,y); lassoPlot(B,FitInfo,'PlotType','Lambda','XScale','log');

Fit a regularized model of the acetylene data with lasso and cross validation, and plot the cross-validated fits:
load acetylene X = [x1 x2 x3]; D = x2fx(X,'interaction'); D(:,1) = []; % No constant term [B FitInfo] = lasso(D,y,'CV',10); lassoPlot(B,FitInfo,'PlotType','CV');

| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |