FeatureHashing
FeatureHashing copied to clipboard
CSCMatrix to dgMatrix not working with plain R command script
my script is
cat_train <- hashed.model.matrix( f, as.data.table(cat_train), HASHING_DIM_ )
I got
Error in as(retval, "dgCMatrix") :
no method or default for coercing “CSCMatrix” to “dgCMatrix”
when I run it in a command line terminal with plain R script environment. But, the code works inside Rstudio.
Please check
Please add:
library(methods)
at the beginning of your script and try again.