Confused about prediction output for glmnet package cv.glmnet model I am using the glmnet package to perform logistic regression on a dataset.
The x.train and x.test data is a simple dataset of numbers.
y.train and y.test is data with categories "Coffee" and "Tea".
Basically the prediction needs to be either "Coffee" or "Tea"
My first question is that do I need to factor the y datasets? I haven't factored them yet.
Secondly, and mainly, this is the problem:
My code is as follows:
lr.fit<-cv.glmnet(x.train, y.train, type.measure="deviance", family = "binomial")
lr.predicted<-predict(lr.fit, s=c("lambda.1se", "lambda.min"), newx=x.test)

However, when I see the output of the lr.predicted variable, I see a list of numbers. I am asking this question because, I was actually expecting predictions like "Coffee", "Tea", "Coffee", "Coffee", "Tea", ........... and so on.
Kindly guide in the right direction. I am a beginner with R and machine learning, so apologies for being an amateur.

You may want to check the reference page for glmnet:

y    response variable. Quantitative for family="gaussian", or
family="poisson" (non-negative counts). For family="binomial" should
be either a factor with two levels, or a two-column matrix of counts
or proportions (the second column is treated as the target class; for
a factor, the last level in alphabetical order is the target class).

For the predict function:

type    Type of prediction required. Type "link" gives the linear predictors (eta scale); Type "response" gives the fitted values (mu
scale). Type "coefficients" computes the coefficients at the requested
values for s. Type "nonzero" returns a list of the indices of the
nonzero coefficients for each value of s.

I believe what you are looking for is type = "class", to get the class with highest probability.
For future references, remember to provide a reproducible example of your issue (both code and data).
