I am trying to save a boost log using the sink function, as the following code:
require(xgboost) require(R.utils) data(iris) train.model <- model.matrix(Sepal.Length~., iris) dtrain <- xgb.DMatrix(data=train.model, label=iris$Sepal.Length) xgb_grid = list(eta = 0.05, max_depth = 5, subsample = 0.7, gamma = 0.3, min_child_weight = 1) sink("evaluationLog.txt") fit_boost <-xgb.cv(data = dtrain, nrounds = 1000, objective = "reg:linear", eval_metric = "logloss", params = xgb_grid, colsample_bytree = 0.7, early_stopping_rounds = 100, nfold = 5, prediction = TRUE, maximize = FALSE ) sink()
However, I donβt see whatβs happening, because it does not print the output of the function and / or message.
My question is, how can I extract a .txt file from sink and see what prints? (in this case will be xgb.cv )?
Thanks!
source share