Solved

Benefits of Python versus R

Posted on 2014-11-13
2
259 Views
Last Modified: 2014-11-19
I’m refactoring someone else’s code that’s been written half in Python and half in R. The core purpose of the code is discriminate analysis. Of course, I think it would be clearly beneficial for performance if only a single language was used, and I’m trying to make an argument one way or another.

The two common areas of debate between R and Python are speed and differences in algorithms (and thus mathematical accuracy). In addition, it’s my understanding that R was chosen from the belief that the validity of the analysis would be more defensible (scientifically) if it were done in R.

So, I’d love some input on two ideas:

1.      In a (specifically) discriminate analysis environment, would R be more defensible (and why)?
2.      In a (specifically) discriminate analysis environment, in what analytical/mathematical ways is R better than Python?

I really appreciate anyone taking the time to respond to this.  

Best!
0
Comment
Question by:Mike R.
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 27

Accepted Solution

by:
d-glitch earned 500 total points
ID: 40441737
Presumably you mean discriminant not discriminate.
     http://www.jmp.com/support/help/Discriminant_Analysis_2.shtml#65479

This topic is covered extensively on line.  This is just one of the threads from Googling "Python vs R"
     http://www.quora.com/Which-is-better-for-data-analysis-R-or-Python

Python is a general purpose interpreted language.
R is also an interpreted language which is targeted at statistical analysis (your application).

I wouldn't worry much about numerical accuracy.  The respective communities are sure to be vigilant.
Speed is apt to be a toss-up as well.  Check the published bench marks for each language.

Community acceptance might dictate a choice of R over Python.  Check with the editors of Journals in your field or scan some recent issues.  And even that decision could be wrong by next year.

One last (frustratingly unhelpful) note:  The hybrid combination of R and Python may be the right choice.
     http://www.r-bloggers.com/python-compliments-rs-shortcomings/
0
 
LVL 27

Expert Comment

by:d-glitch
ID: 40448208
Several criteria can be used to justify the choice of a particular language:

Exigency:  If the project is incomplete, and needs to be completed soon, use the language you know best.

Authority:  If external authorities require a particular language, use it even if there is a learning curve.

Expediency:  Use a combination of languages if that gets the job done fastest.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Flask is a microframework for Python based on Werkzeug and Jinja 2. This requires you to have a good understanding of Python 2.7. Lets install Flask! To install Flask you can use a python repository for libraries tool called pip. Download this f…
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question