Parallelizing Machine Learning Algorithms


R Data Science: R Programming A-Z: R For Data Science With Real Exercises!

In R, we can run machine learning algorithms in parallel model with doParallel and caret packages.
library(caret)
library(doParallel)
set.seed(1)
ctrl <- trainControl(method="repeatedcv", repeats=5, classProbs=TRUE)
#Run model in parallel
cl <- makeCluster(detectCores())
registerDoParallel(cl)
getDoParWorkers()

model = train(Species~., data = iris, method='rf', trControl= ctrl)
Coursera Data Science

R Tutorials : 75 Free R Tutorials

Get Free Email Updates :
*Please confirm your email address by clicking on the link sent to your Email*

Related Posts:

0 Response to "Parallelizing Machine Learning Algorithms"

Post a Comment

Next → ← Prev