套索
套索或弹性净正规化线性模型
描述
B
=套索(<一个href="//www.tatmou.com/it/help/stats/#d124e605510" class="intrnllnk">X,<一个href="//www.tatmou.com/it/help/stats/#d124e605534" class="intrnllnk">y)
返回符合最小二乘回归系数的线性模型预测数据X 和响应y 。每一列的B 对应于一个特定的正则化系数<一个href="//www.tatmou.com/it/help/stats/#d124e605940" class="intrnllnk">λ。默认情况下,套索 使用几何序列执行套索正规化λ 值。
B
=套索(<一个href="//www.tatmou.com/it/help/stats/#d124e605510" class="intrnllnk">X,<一个href="//www.tatmou.com/it/help/stats/#d124e605534" class="intrnllnk">y,<一个href="//www.tatmou.com/it/help/stats/#namevaluepairarguments" class="intrnllnk">名称,值)
正规化回归符合附加选项指定一个或多个参数名称-值对。例如,“阿尔法”,0.5 集弹性网的正则化方法,参数α 等于0.5。
(<一个href="//www.tatmou.com/it/help/stats/#d124e606668" class="intrnllnk">B,<一个href="//www.tatmou.com/it/help/stats/#d124e606717" class="intrnllnk">FitInfo)=套索(___ )
还返回结构FitInfo 的配合,其中包含的信息模型,使用任何输入参数在前面的语法。
例子
使用套索正规化创建线性模型没有截距项
创建示例数据和预测变量X 和响应变量
。
rng (“默认” )%的再现性 X =兰德(100 1);y = 2 * X + randn (100 1) / 10;
指定正则化值,找出系数回归模型没有截距项。
λ= 1 e 03;B =套索(X, y,“λ” λ,“拦截” 假)
警告:当“拦截”值是false,“标准化”值设置为false。
B = 1.9825
情节真实值(点)与预测值(线)。
散射(X, y)在 x = 0:0.1:1;情节(x, x * B)从
返回符合最小二乘回归系数的线性模型预测数据B
=套索(<一个href="//www.tatmou.com/it/help/stats/#d124e605510" class="intrnllnk">X,<一个href="//www.tatmou.com/it/help/stats/#d124e605534" class="intrnllnk">
y)
λ。默认情况下,
正规化回归符合附加选项指定一个或多个参数名称-值对。例如,B
=套索(<一个href="//www.tatmou.com/it/help/stats/#d124e605510" class="intrnllnk">X,<一个href="//www.tatmou.com/it/help/stats/#d124e605534" class="intrnllnk">
y,<一个href="//www.tatmou.com/it/help/stats/#namevaluepairarguments" class="intrnllnk">
名称,值)
(<一个href="//www.tatmou.com/it/help/stats/#d124e606668" class="intrnllnk">
还返回结构B,<一个href="//www.tatmou.com/it/help/stats/#d124e606717" class="intrnllnk">
FitInfo)=套索(
例子
使用套索正规化创建线性模型没有截距项
创建示例数据和预测变量
rng (“默认” )%的再现性 X =兰德(100 1);y = 2 * X + randn (100 1) / 10;
指定正则化值,找出系数回归模型没有截距项。
λ= 1 e 03;B =套索(X, y,“λ” λ,“拦截” 假)
警告:当“拦截”值是false,“标准化”值设置为false。
B = 1.9825
情节真实值(点)与预测值(线)。
散射(X, y)在 x = 0:0.1:1;情节(x, x * B)从