from sklearn import linear_model
reg=linear_model.LassoLars(alpha=0.1)
print(reg.fit([[0,0],[1,1]],[0,1]))#LassoLars(alpha=0.1, copy_X=True, eps=2.220446049250313e-16,fit_intercept=True, fit_path=True, max_iter=500, normalize=True,positive=False, precompute='auto', verbose=False)
print(reg.coef_)#[0.71715729 0. ]
Lars算法几乎可以免费提供沿正则化参数的系数的完整路径,因此常见的操作包括用函数lars_path检索路径