3 ms·
It really hasn't. Python has pretty good support for machine learning on data with no missing values. It doesn't really support things like survival analysis,
by disgruntledphd2 9y ago
It really hasn't. Python has pretty good support for machine learning on data with no missing values.
It doesn't really support things like survival analysis, complicated time series models or (the most important) missing data.
Also, R's formula interface for models is a thing of beauty, while Python has nothing similar.
So, if you have data with no missings and are only interested in a small subset of statistics (that used by computer scientists), then Python can definitely suffice.
If you are in almost any other discipline, you're going to be using R.
Don't get me wrong, Python is a wonderful language, but R is so well adapted to analysis that it will be a very long time before it gets replaced (Julia looks really promising, but its not at 1.0 yet, and hence hasn't seen the broad scale adoption it would need).
- wrinkl3 9y agoSo why has nobody tried to implement something similar for Python? Is there some fundamental limitation of the language at play?
- ForHackernews 9y agoAcademic statisticians know and use R. They publish research in R. Python doesn't have the same mindshare, so somebody would have to specifically go out and re-implement it in Python. So far, it seems like nobody has been sufficiently motivated to do so.
- singingfish 9y agoYou'd basically be implementing a new interpreter (and presumably trying to do so in python). And hauling in a bunch of Fortran bindings along for the ride.
- singingfish 9y agoIt's not just that. R has a few things going for it: 1. It's a functional language, and functional programming style lends itself really well to matrix operations (and the engine of stats is all about matrices). 2. Matrices are baked really deeply into the language, which makes the functional style even more powerful. (my understanding is that what makes the formula interface work so well). 3. R can be viewed as coating of syntactic sugar on a lot of very useful fortran libraries. On the other hand I once saw some open source toolkit for natural language processing in R. I had two issues with that. Firstly WTF was the author thinking doing all his general purpose programming in R. And two I didn't want to investigate further because as NLP is largely about general purpose operations and I didn't want to get sucked into that rabbit hole.
- jkabrg 9y agoOne thing I don't like about Python libraries, from the top of my head: That there is a distinction between functions and methods, e.g. between nansum(a) and a.sum() where a is a numpy array. The distinction is illogical and just has to be memorized, much like the difference between different categories of verbs in French. In contrast, R uses an exotic form of object oriented programming called multimethods, which doesn't make a distinction between object.method() and method(object). And if you like chaining methods together like object.method1().method2().method3(), then you can do that in R using the piping operator from the Dplyr package: object %>% method1() %>% method2() %>% method3(), which is rightly equivalent to method3(method2(method1(object)))
- goatlover 9y agoThe reason there is a distinction in Python between functions and methods is because Python supports multiple paradigms. It doesn't force the programmer into using OOP. Sometimes you want a function that doesn't belong to some kind of data type, and sometimes you want to create a new type of data and define methods that work only for it.
- singingfish 9y agoYou make it sound like perl (only perl is more flexible - both its major strength and weakness)