FeatureHashing icon indicating copy to clipboard operation
FeatureHashing copied to clipboard

CSCMatrix to dgMatrix not working with plain R command script

Open tongjiyiming opened this issue 6 years ago • 1 comments

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

tongjiyiming avatar Jul 24 '19 19:07 tongjiyiming

Please add:

library(methods)

at the beginning of your script and try again.

wush978 avatar Jul 27 '19 13:07 wush978