3 ms·
Kind of, but the R code is written a little oddly to my eye.
by jtth 11y ago
Kind of, but the R code is written a little oddly to my eye.
- CJKinni 11y agoHow so? As someone familiar with Python but not R, I've always been hesitant to jump in. This code was very readable and made me think that it might be a far more accessible language than I'd previously assumed.
- geomark 11y agoOne example in the section titled "Split into training and testing sets" would be to use the createDataPartition() function from the caret package for creating training and testing sets. He says "In R, there are packages to make sampling simpler, but aren’t much more concise than using the built-in sample function" but using caret is more concise. Added: Later in the section on random forests he says "With R, there are many smaller packages containing individual algorithms, often with inconsistent ways to access them." Which is why you want to use the caret package as it makes accessing many machine learning packages consistent and easy.
- Pinatubo 11y agoMe too. Why for example did they use an sapply for column means when they could have just used colMeans with na.rm=T?
- compbio 11y agoThat is a major difference between these two languages. Python: There should be one, and only one, preferable way to do things. Though this may not be obvious at first. R: Every author has a different style of doing things, reflecting in the code. As for the comparison in general: You can call R from within Python. So Python is at least as powerful as R. The rest (BeautifulSoup, Compression, Game development etc.) is icing on the cake.