2017-02-27 49 views
0

我試圖導入使用h2o.importfile大.csv文件中的R過多的水平/類別h2o.importFile加載數據時出錯()

library(h2o) 
h2o.init() 
dataFile <- "big_file.csv" 
h2o.importFile(dataFile,header=TRUE,destination_frame = "data.hex") 

的文件裏有一些ID列。我收到以下錯誤消息。

錯誤:water.parser.ParseDataset $ H2OParseException:超出列[id1,id2]的分類限制。考慮將這些列重新解析爲一個字符串。

是指定這些科拉姆類型爲字符串類似data.frame(stringAsFactors = FALSE)

回答

1

指定col.types論點h2o.importFile功能應該爲你在那裏工作的方式。

write.csv(iris, "iris.csv") 
hf0 <- h2o.importFile("iris.csv", col.types = c("int","real","real","real","real","string")) 
unlist(h2o.getTypes(hf0)) 
[1] "int" "real" "real" "real" "real" "string"