Machine learning algorithm benchmarked in Matlab, R and Scala(blog.brusic.com)
blog.brusic.com
Machine learning algorithm benchmarked in Matlab, R and Scala
http://blog.brusic.com/2011/08/machine-learning-ex2-benchmarks.html
5 comments
None of this is as fast or efficient as implementing most of the stuff in python/scipy and reimplementing the occasional hot spot in C++ :)
I've found Matlab to consistently outperform numpy (the gap growing in recently releases adding multithreading supprt to Matlab), and the C++ interface is pretty much equally convenient. (Weave is awesome for python, but only really usable in small toy problems.)
I wonder if in his installation of R he has ATLAS build in as the linear algebra workhorse. That seems to be optimized for something like this- I wonder how this would affect R's speed.
This post compares Octave, not MATLAB. Similar languages, but completely different implementations. I'd bet that if it were tested in MATLAB, it'd be much faster.
Just joined hacker news in order to comment.
You are correct, the MATLAB code was tested in Octave. I would not have worded the title HN is such a way. The goal is to learn the algorithms involved, not trying to come up with the fastest version possible. The interesting part is actually the performance of the JVM, not the comparison between languages.
You are correct, the MATLAB code was tested in Octave. I would not have worded the title HN is such a way. The goal is to learn the algorithms involved, not trying to come up with the fastest version possible. The interesting part is actually the performance of the JVM, not the comparison between languages.
I've observed (when doing Computer Vision algorithms) that MATLAB can be 10-times faster, in certain very tight loop calculations even more than 100-times faster than Octave.
So I don't think those are really representative of MATLAB performance.
So I don't think those are really representative of MATLAB performance.
Good luck spending thousands of man-years reimplementing all of statistics and numeric computing in Scala.
But how about reimplementing R in Scala? Or, better yet, in Clojure? The best of both worlds.
I'm sure you're already aware of this, but just in case:
http://incanter.org/
http://incanter.org/
Indeed, Incanter is a famous project and for a while was one of the best showcases for Clojure.
What it does is it implements some of the functionality of R in Clojure. What I am talking about is instead compiling R to Clojure (or Java runtime; there are portions of R projects implemented in C which may not map to Clojure efficiently). This way, the R community does not lose the extensive library of projects it has been producing for years.
What it does is it implements some of the functionality of R in Clojure. What I am talking about is instead compiling R to Clojure (or Java runtime; there are portions of R projects implemented in C which may not map to Clojure efficiently). This way, the R community does not lose the extensive library of projects it has been producing for years.
When it comes to prototyping, using languages such as scala brings nothing for such type of mathematical algorithms as it is basically only loops and double operations. You are better off with languages such as R/scipy where most of the core is written in C/C++ and handily wrapped (there are many heavily optimized packages in R to do gradient descent).
For production code, well, you know the correct solution ;)