2
누군가가 R에서 패키지 lars
의 올가미 회귀 계수를 구하는 방법을 말해 줄 수 있습니까? R에서 Lasso 회귀 분석에서 계수를 얻는 방법?
test_lasso=lars(A,B)
감사합니다 : 같은 예를 들어
코드 인 경우.
누군가가 R에서 패키지 lars
의 올가미 회귀 계수를 구하는 방법을 말해 줄 수 있습니까? R에서 Lasso 회귀 분석에서 계수를 얻는 방법?
test_lasso=lars(A,B)
감사합니다 : 같은 예를 들어
코드 인 경우.
#First get cross validation score:
test_lasso_cv=cv.lars(A,B)
# Find the best one
bestfraction = test_lasso_cv$index[which.min(test_lasso_cv$cv)]
#Find Coefficients
coef.lasso = predict(test_lasso,A),s=bestfraction,type="coefficient",mode="fraction")