Hot answers tagged

28

Python is more "general purpose" while R has a clear(er) focus on statistics. However, most (if not all) things you can do in R can be done in Python as well. The difference is that you need to use additional packages in Python for some things you can do in base R. Examples: Data frames are base R while you need to use Pandas in Python. Linear ...


13

Python being more widely used is an important consideration. This will especially become important when applying for a job. Also Python has as many if not more key statistical and ML/AI tools as R, and a larger open-source base to utilize. Python is designed for programmers, R is designed for statisticians. Originally I was a R programmer, but most of my ...


4

I'd like to add two points to the existing answers: There is excellent interaction between R and python, with various possibilities for either direction. To me, it's not that much of a decision python vs. R. The decision is to choose the main language appropriately for the project at hand, and then do parts in the other language if that is better for some ...


3

One thing that can be a gotcha coming from R to Python is that the Python stats ecosystem tends to be more machine learning-ey oriented rather than inferential stats-ey oriented. This can create some hiccups, because some of the defaults in R that are the defaults because people who do inferential stats like in the social sciences always use them, are not ...


2

One reason why you aren't getting fitted values close to the true values could be the initial values of the parameters used. It's likely what you have found is a local maxima. You have to try a number of initial starts and then pick the one with that gives the highest likelihood.


2

Welcome to the community! There are more intuitive ways to do this like calculating pair-wise distances from vectors in the space but this is not scalable properly. The second point is that even if you want to go this way, it is better to put them in a weighted graph through e.g. Networkx library and then find longest path between two nodes or detecting ...


2

This is a really interesting question about the motivation behind Object orientated programming. The main reason that makes OOP particularly attractive is the reusability of functions and objects which you can reuse in different analysis. For example, for one NLP model, you create a function which cleans text (returns lowercase text, free from stopwords). A ...


2

Is that intuition correct Yes There is no improvement in Cluster quality. All the 3 are the same and should be that way. We can easily observe that all the 3 clusters are forming the elbow at 2.5. Even all other aspects of the 3 plots are exactly the same. Within Cluster Sum of Squares (WCSS) measures the squared average distance of all the points within a ...


2

Welcome to the community! Some points which might help: Clustering, as an unsupervised task, can not be evaluated and usually some external criteria are used to find the best clustering. According to the point above, better to make those assumptions as direct as possible. Starting with EDA (inspecting histograms, plotting boxplots, etc.) gives you a better ...


2

I eventually do plan on moving more towards ML One aspect that I would like to add based on what I observed. Things are moving with more focus towards Deep Learning e.g. Neural Networks and in this space, most of the dominating Libraries supports Python as first choice. Companies manage a separate Python version to open-source, just to maintain the user ...


1

I would suggest to use a topic model first (like Latent Dirichlet Allocation) and assign score values to the topics instead of single words.


1

What you're describing is indeed the traditional approach for building a sentiment analysis system, so I'd say it looks like a reasonable approach to me. I'm not up to date with the sentiment analysis task at all, but I think it would be worth studying the state of the art for several reasons: There might be more recent, better approaches There might be ...


1

For the love of the flying spaghetti monster, use anaconda to install the needed packages for data science. I have seen both Python and R being used in the data science setting and both needed additional packages to execute any data science capabilities. Conda made it way easier to install them. From my point of view, Python has a better support for all ...


1

Class weights make sense only in the context of a loss function. When you validate your model you are making predictions and comparing to ground truth using a metric - but in that phase you aren't propagating back any changes, so weights are useless.


1

You can do that. I propose the simplest one conditioned on the fact that number of data is not very large. In case you need more ideas please drop a comment. In this case, you can use the idea of similarity encoding based on Fuzzy String Matching and get the spectral embedding. The amount of data is crucial here as you need to do order of $n^2$ comparisons ...


1

There are lots of things that might lead to this performance. With the very limited information provided I can only guess and suggest the reasons. I have personally used lots of Pacman variations (including this one) with RL models successfully. My first initial guess is that you are stopping exploration too early. Pacman environments are very hard to solve (...


Only top voted, non community-wiki answers of a minimum length are eligible