model.matrix Questions
1
Solved
I am using the dummies package to generate dummy variables for categorical variables, some with more than two categories.
testdf<- data.frame(
"A" = as.factor(c(1,2,2,3,3,1)),
"B" = c('A','B...
Carcass asked 17/6, 2019 at 18:48
1
Solved
I've trained an elastic net model in R using glmnet and would like to use it to make predictions off of a new data set.
But I'm having trouble producing the matrix to use as an argument in the pre...
Goddord asked 21/8, 2018 at 15:58
2
Solved
I am having a problem to run glmnet lasso with a wide data set. My data has N=50, but p > 49000, all factors. So to run glmnet i have to create a model.matrix, BUT i just run out of memory when i c...
Menides asked 10/6, 2013 at 20:29
2
Solved
I have a data table and I want to create a new column for each unique day, and then assign a 1 in each row where the day matches the column name
I have done this using a for loop but I was w...
Doubletime asked 22/7, 2016 at 12:9
2
Solved
I would like to create a matrix of indicator variables. My initial thought was to use model.matrix, which was also suggested here: Automatically expanding an R factor into a collection of 1/0 indic...
Overslaugh asked 22/12, 2012 at 2:24
1
© 2022 - 2024 — McMap. All rights reserved.