I use glmnet to predict probabilities based on a set of 5 functions using the following code. I need the actual formula because I need to use it in another (not R) program.
deg = 3 glmnet.fit <- cv.glmnet(poly(train.matrix,degree=deg),train.result,alpha=0.05,family='binomial')
The names of the obtained coefficients have five positions (I assume that this is one of each function), and each of them represents a number from 0 to 3 (I assume that this is the degree of the polynomial). But I'm still confused about how exactly to restore the formula.
Take them, for example:
> coef(glmnet.fit,s= best.lambda) (Intercept) -2.25e-01 ... 0.1.0.0.1 3.72e+02 1.1.0.0.1 9.22e+04 0.2.0.0.1 6.17e+02 ...
Let me name the functions A, B, C, D, E. This is how to interpret the formula?
Y = -2.25e-01 + ... (3.72e+02 * (B * E) + (9.22e+04 * (A * B * E) + (6.17e+02 * (B^2 + E) ...
If this is not the case, how should I interpret it?
I saw the following question and answer , but did not name these types of coefficient names.
Thanks in advance for your help.
dougp source share