Quantcast
Channel: ListenData
Viewing all articles
Browse latest Browse all 425

Parallelizing Machine Learning Algorithms

$
0
0
In R, we can run machine learning algorithms in parallel model with doParallel and caret packages.

Parallel Computing with R
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)

Viewing all articles
Browse latest Browse all 425

Trending Articles