www.gusucode.com > stats 源码程序 matlab案例代码 > stats/LassoPlotWithLambdaPlotTypeExample.m
%% Lasso Plot with Lambda Plot Type % Load the sample data. load acetylene %% % Prepare the data for lasso fit with interactions. X = [x1 x2 x3]; D = x2fx(X,'interaction'); D(:,1) = []; % No constant term %% % Fit a regularized model of the data with |lasso| . [B,FitInfo] = lasso(D,y); %% % Plot the fits with the |Lambda| plot type and logarithmic scaling. lassoPlot(B,FitInfo,'PlotType','Lambda','XScale','log');