I intend to convert output from LASSO regresson to csv file.
First, I try to convert matrix to data.frame:
lasso_model = glmnet(x,y,alpha=1,lambda=c(0.0000000001,0.000000001,0.00000001,0.0000001,0.000001,0.00001,0.0001,0.001,0.01,0.1,1))
Then, there appears this problem:
Error in as.data.frame.default(a) :
cannot coerce class ‘structure("dgCMatrix", package = "Matrix")’ to a data.frame
Could you please help me ?