-
Notifications
You must be signed in to change notification settings - Fork 14
Performance
Qiang Kou edited this page Jul 24, 2014
·
1 revision
Even without a performance testing, we are still sure the C++ implementations should be faster. A small wine data set from UCI data sets repository is used for benchmarking. rbenchmark package is also used.
suppressMessages(library(rbenchmark))
res <- benchmark(mlKmeans(t(wine),3),
kmeans(wine,3),
columns=c("test", "replications", "elapsed",
"relative", "user.self", "sys.self"), order="relative")
From benchmarking result, we can see that MLPACK version of k-means is 33-time faster than \texttt{kmeans()} in R. However, we should note that R returns more information than the clustering result and there are much more checking functions in R.
test | replications | elapsed | relative | user.self | sys.self |
---|---|---|---|---|---|
mlKmeans(t(wine), 3) | 100 | 0.028 | 1.000 | 0.028 | 0.000 |
kmeans(wine, 3) | 100 | 0.947 | 33.821 | 0.484 | 0.424 |