Having an issue while running a logistic regression model using caret::train().
LR = caret::train(Satisfaction ~., data= log_train, method = "glm", preProcess = c("scale"), family="binomial")
keep getting the following line of error:
Error in summary.connection(connection) : invalid connection
This error seems new to me as when i had previously run this code, i did not see any issue. Please help!
I got this error because of an issue with the parallel computing back-end for foreach/dopar. You may have some parallel computing going on in the background that is not getting cleaned up fully between runs. The easiest way I have found to fix it is to call this function:
unregister_dopar <- function() {
env <- foreach:::.foreachGlobals
rm(list=ls(name=env), pos=env)
}
This function is from Steve Weston's accepted answer in this thread: "un-register" a doParallel cluster
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With