I am using R glmnet package for elastic net and results look like this:
TRTREJ6M_KIY .
TXKIDE -1.317048e-01
TXKIDL .
TXKIDR .
URINE_INF_DON .
VASODIL_DONN .
VASODIL_DONU .
VASODIL_DONY .
I have tried this:
print1
function(riskcoef99){ind <- which(coef(riskcoef99) != 0)
df <- data.frame(
feature=rownames(coef(riskcoef99))[ind],
coeficient=coef(riskcoef99)[ind]
)
kable(df)
}
and this:
colnames(risklevelcsv)[which(coef(riskCV99,s="lambda.min") != 0)]
The glmnet file name is riskCV99 and I have save coefs with riskcoef99 file. Please help me out to write the results into csv, excel or text file I have been trying for the last 2 days and couldnt fugure out. Thanks in advance