2014-09-02 2 views

답변

3
#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") 
관련 문제