tobigithub / caret-machine-learning

Practical examples for the R caret machine learning package
MIT License
67 stars 50 forks source link

gamLoess crashes R GUI in parallel mode #25

Open tobigithub opened 8 years ago

tobigithub commented 8 years ago

gam_1.12 under caret_6.0-58 crashes R-GUI (hard error) under Windows

# load caret and DT the cars data set
require(caret); require(DT);  require(mlbench);
library(AppliedPredictiveModeling)
data(solubility)

# load the data and coerce into single frame (legacy)
training_data = data.frame(solTrainX,solTrainY)[1:20,]
testing_data = data.frame(solTestX,solTestY)

# just rename columsn to stay conform with style below
colnames(training_data)[colnames(training_data) == 'solTrainY'] <- 'y'
colnames(testing_data)[colnames(testing_data) == 'solTestY'] <- 'y'

# all the training data (just named x and y)
y <- training_data$y
x <- training_data[, -ncol(training_data)]

# load all libraries
library(doParallel); cl <- makeCluster(8); registerDoParallel(cl)

train(x,y,"gamLoess")

# stop the parallel processing and register sequential front-end
stopCluster(cl); registerDoSEQ();
tobigithub commented 8 years ago

See also http://stackoverflow.com/questions/32043010/r-crashes-when-training-using-caret-and-method-gamloess