Displaying 1 result from an estimated 1 matches for "matrixify".
Did you mean:
matrix_ty
2012 Feb 09
1
How to properly build model matrices
...el.matrix(label~., read.csv('train.csv'))
target = model.matrix(label~., read.csv('target.csv'))
(1) The two may have different factor levels, yielding different
matrices. I usually first rbind the data frames together to "meld"
the factors, and then split them apart and matrixify them.
(2) The target set that I'm predicting on typically doesn't have
labels. I usually manually append dummy labels to the target data
frame.
(3) I almost always remove the Intercept from the model matrices,
since it seems to always be redundant (I usually use caret).
None of these is...