Parallelizing Machine Learning Algorithms

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)

R Tutorials : 75 Free R Tutorials

About Author:

Deepanshu founded ListenData with a simple objective - Make analytics easy to understand and follow. He has over 7 years of experience in data science and predictive modeling. During his tenure, he has worked with global clients in various domains like banking, Telecom, HR and Health Insurance.

While I love having friends who agree, I only learn from those who don't.

Let's Get Connected: Email | LinkedIn

Get Free Email Updates :
*Please confirm your email address by clicking on the link sent to your Email*
Related Posts:
1 Response to "Parallelizing Machine Learning Algorithms"
  1. Why do we need to run parallel algorithm?

    ReplyDelete

Next → ← Prev