Just How Good Is ChatGPT in Data Science?

Many of you may have heard of ChatGPT, a dazzling new AI tool. We are hearing lots of gushing praise for the tool. Well, how well does it do in data science contexts? I tried a few queries here, and found interesting results.

I first requested, “Write an R function that returns every other element of a vector x, starting with the third.” I won’t show the code here, but suffice it to say that it worked! It did give me correct code.

Next, “In R’s built-in dataset CO2, fit a linear regression with ‘uptake’ as the outcome variable, and find the standard error of the intercept term.” Alas, it begged ignorance: “…I do not have the ability to perform calculations or access specific datasets…” Not really true; unfortunately, ChatGPT was not able to pick up the key phrase, “built-in.”

I then gave it what turned out to be an easier question, ” In the output of R’s ‘lm’ function, how do I find the standard error of the intercept term?” It returned a correct and useful answer, stating the ‘lm’ returns lots of material, “…including the standard errors of the model coefficients. The standard error of the intercept term can be accessed by calling the summary function on the model object and looking at the output…”

Next: “In R, what are the advantages of using the density() function in iieu of hist()?” The reply had some correct ingredients, but had problems:

“…the resulting plot [from density()] is smoother and more continuous, which can make it easier to see the underlying distribution of the data. This can be especially useful when the data is noisy or when the number of data points is small…The density function allows you to specify the bandwidth, or the smoothness, of the curve, which can be useful for highlighting different features of the data. In contrast, the hist function does not allow you to control the smoothness of the resulting plot.”

Putting aside the fact that the phrase “more continuous” is nonsense, there are other issues. It is not necessarily true that density() will do better on small/noisy data. And the app misses the point that hist() does have an analog of the bandwidth, namely the bin width.

Finally, I asked a question that every statistician is asked by non-stat people: “How can public opinion polls be accurate if they are based on only a small fraction of the population?” The response (not shown here) notes some standard practices such as stratified sampling, but basically begs the question.

Say for example 1200 people are sampled, as is common, and we stratify by race, That would mean we design the sample to include about 160 Black people. But anyone who wondered about the small sample overall would be even more puzzled as to why 160 African-Americans is “representative.”

So in this case, ChatGPT would give a very misleading answer to an important, common question.

And we see that machines can fail Statistics, just like college students. 🙂

9 thoughts on “Just How Good Is ChatGPT in Data Science?”

  1. This pattern percolates through other sciences and applications, and AI shares the misplaced confidence of many of its users: “The bot’s answers to questions regarding coding problems [on Stackoverflow] often needed to be corrected. The scary thing was how incorrect and confident it was, said one user. The text was very well written but it contained many errors.” (from: theinsaneapp.com – “ChatGPT AI Generated Answers Banned On Stack Overflow”)

  2. Greetings of the day, I can readily understand the idea as a learner – “JUST HOW GOOD IS CHATGPT IN DATA SCIENCE?”. This topics such as describing on chat GPT in data science which I’m searching for and it was clear and neat. These are the most informative idea and is too good. I appreciate you for giving the information!

  3. It’s amazing to think about how far we’ve come in terms of natural language processing and machine learning, and the potential applications for these technologies in fields like data analysis and predictive modeling are truly exciting.

    As someone who has used ChatGPT myself, I can attest to the impressive capabilities of this language model. Its ability to generate human-like responses and understand the nuances of language is truly remarkable.

    However, as you point out in your post, there are limitations to what a language model like ChatGPT can do in terms of data science. While it can certainly be used to analyze and understand text data, it may not be the best tool for more complex tasks like data visualization and statistical modeling.

    It’s clear that these technologies have tremendous potential, but we must also be mindful of their limitations and use them in conjunction with other tools and techniques to achieve the best possible results.

  4. Great article. I thoroughly enjoyed reading your insightful blog post on chatgpt! The way you have explained is both informative and engaging.
    Thanks for sharing. Please keep sharing articles like that.

  5. For your second question, you would have received an answer if you had asked ChatGPT to write you an R-script that does that. It can’t use R or perform the regression itself, but it will give you a script that does what you want it to do. He also uses the correct dataset “CO2”! ;D

    Nevertheless, the R-code that I asked it to write was often inaccurate, wrong or slow and cumbersome. Not really the best way of programming … although it does sometimes hint you towards things that you didn’t think about in the first place! Only, one needs to be the one to implement it correctly and efficiently…

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.