MATH 456 Homework 09, help
- Use the library
glmnetto fit a cross-validated regularizedfamily = multinomialmodel model that predicts whichislandeach penguin is from.
To help you get started on 1., here's the some pseudocode to set up the problem.
df$i <- factor(df$island, labels = c("Biscoe", "Dream", "Torgersen"))
mf <- model.frame(i ~ x, data = df) # x represents arbitrary explanatory variables
X <- model.matrix(mf, data = df)
y <- model.response(mf)