how to implement external memory version of xgboost in R

Viewed 10

I try to implement an example of the xgboost external memory version in R. Please see paragraph 3 from this post:

https://www.r-bloggers.com/2017/01/parallel-computation-with-r-and-xgboost/

I have downloaded the datafile agaricus.txt.train from the link provided:

https://github.com/dmlc/xgboost/tree/master/demo/data

I have tried several options below:

library(xgboost)

setwd("D:/test")

agaricus.txt.train <- read.table(file = "agaricus.txt.train.txt", header = TRUE)
dtrain = xgb.DMatrix('agaricus.txt.train')
dtrain = xgb.DMatrix(agaricus.txt.train)

agaricus.txt.train <- read.delim("agaricus.txt.train.txt", header = TRUE)
dtrain = xgb.DMatrix('agaricus.txt.train')
dtrain = xgb.DMatrix(agaricus.txt.train)

Although these result in the folowing errors:

Error in xgb.DMatrix("agaricus.txt.train") : 
[12:47:44] C:\Users\Administrator\workspace\xgboost-win64_master\src\data\data.cc:892: Encountered parser error:
[12:47:44] C:\Users\Administrator\workspace\xgboost-win64_master\dmlc-core\src\io\local_filesys.cc:86: LocalFileSystem.GetPathInfo: agaricus.txt.train error: No such file or directory
    
Error in xgb.DMatrix(agaricus.txt.train) : 
xgb.DMatrix does not support construction from list

I read in the post that "For windows users with mingw, however, is not able to try it out". Could this be the reason for these errors? Indeed I have the app mingw on my Windows 10 system. Although I do not know for which reason. I am not sure if I can uninstall it without consequences.

Thanks a lot!

PS: I am aware that I can also download the agaricus data with the code below, although the agaricus files above are in a specific dgCMatrix format needed for the external memory version if I understand correctly.

data(agaricus.train, package='xgboost')
data(agaricus.test, package='xgboost')
train <- agaricus.train
test <- agaricus.test
0 Answers
Related