Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eror caused by sink("NUL") #3

Closed
oscardelama opened this issue Apr 11, 2019 · 2 comments
Closed

Eror caused by sink("NUL") #3

oscardelama opened this issue Apr 11, 2019 · 2 comments

Comments

@oscardelama
Copy link

oscardelama commented Apr 11, 2019

Hi Sam.

I was trying to learn the basics of your package by implementing the example code in your package Readme file. The BayesianOptimization starts but few seconds later, a seemingly silly error, aborts it. The culprit is sink("NUL") (line 241):

Error in file(file, if (append) "a" else "w") : cannot open the connection
3. file(file, if (append) "a" else "w")
2. sink("NUL")
1. BayesianOptimization(FUN = xgb_optim, bounds = bounds, initPoints = 9, bulkNew = 1, nIters = 200, kern = kern, acq = acq, kappa = 2.576, verbose = 1, parallel = FALSE)

Reading this thread (between Hadley Wickham & Brian Ripley nothing less!) I found that you can use:
sink("/dev/null")
but it doesn't work in Windows. In Windows you can use:
sink("nul:")
but that works only in Windows. A cross-OS solutions might be:
sink(tempfile())

By the way I am using "Linux Mint 19.1 Tessa Xfce" and a fresh installation of R:

R version 3.5.3 (2019-03-11) -- "Great Truth"
Copyright (C) 2019 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

I am eager to try your package for job related tasks!

Cheers.

@AnotherSamWilson
Copy link
Owner

Interesting, that function does not cause a failure on the other Linux operating systems:
https://cran.r-project.org/web/checks/check_results_ParBayesianOptimization.html

I'll look into sink(tempfile()) and let you know if it works!

@AnotherSamWilson
Copy link
Owner

Fixed in commit ce6ab38. Messages from scoring function now sink into an anonymous file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants