Wine + GPT4 + Code Interpreter: WOW!!

by | Tuesday, July 11, 2023

OpenAI just released Code Interpreter. It allows you to execute Python code within a live working environment. One of the things that it allows us to do is take data files and conduct data analysis and create graphs and charts.

Not knowing what that meant I decided to play with it. So I found a publicly available database on wine quality (and why not? Don’t give me that look) and imported it into Code Interpreter. I am not including the entire conversation I had with GPT but provide some key excerpts below. You can read the entire interaction in this linked pdf document.

So I started with a complete blank slate. I had no idea what I was doing. So I started the conversation with:

Can you create some interesting data visualizations based on this dataset?

After looking over the data, it suggested the following:

For instance, we can examine the distribution of quality ratings for both types of wine, the correlation between different properties and the quality of the wine, and some other interesting relationships. Does that sound good to you?

And once I said yes, within seconds I had the following diagram, with the explanation below.

In the first plot, “Distribution of Quality Ratings for Each Wine Type,” we can see that the majority of wines, both red and white, have a quality rating of 5, 6, or 7. White wine tends to have slightly higher quality ratings overall compared to red wine. In the second plot, “Distribution of Alcohol Content for Each Quality Rating,” we see that higher-quality wines generally contain more alcohol. This is true for both red and white wines. The trend suggests that wines with higher alcohol content tend to be rated better in quality.

Hmmm… wines with higher alcohol content tend to be rated higher! Why am I not suprised 🙂

Not sure of what to do next, I wrote:

I am interested in some cool visualizations that can emerge from this analysis. What would you suggest?

After a bit of back and forth, where it provided me with a variety of options, I asked it to create a correlational heatmap. Within seconds I had the following.

Here’s the correlation heatmap of the wine properties. From the heatmap, we can observe that:

  1. The alcohol content has a relatively strong positive correlation with the quality of the wine. This observation aligns with our earlier analysis where we noticed that higher-quality wines generally contain more alcohol.
  2. The density of the wine has a somewhat strong negative correlation with the quality of the wine. This suggests that higher-quality wines tend to have a lower density.
  3. The volatile acidity also has a negative correlation with the quality of the wine, implying that better-quality wines tend to have lower volatile acidity.
  4. There are also some strong correlations between different properties of the wine, which are not directly related to the quality. For example, density has a strong positive correlation with residual sugar.

This is when I had to jump onto a meeting in zoom, so I hit pause.

Let me just add that all this took just 20 minutes, maybe less.

I am still trying to wrap my head around this. But the possibilities appear endless and I am constrained by nothing but my imagination.

A few randomly selected blog posts…

TPACK in Spanish

TPACK in Spanish

Back in 2013 we (Koehler, Mishra and Cain) published an updated version of an article on TPACK. Koehler, M. J., Mishra, P., & Cain, W. (2013). What is Technological Pedagogical Content Knowledge (TPACK)? Journal of Education (193)3, 13-20. This article was...

Amruta Patil’s Family Album

A few weeks ago I had featured Nina Paley, animator and story teller. I just discovered another amazing talent: graphic artist Amruta Patil. I got know Amruta through the desi blog ultrabrown which recently featured an interview (Amruta Patil and Kari: A short Q&A)...

Happy Thanksgiving

Happy Thanksgiving

A new design for my favorite holiday of the year. See animated version below. Enjoy Previous designs can be found here and here.

Too cool for school: Using the TPACK framework

Matt Koehler and I just published an article in Learning & Leading with Technology, the membership magazine of the International Society for Technology in Education (ISTE). The complete citation is as follows: Mishra, P., & Koehler, M. J. (2009, May). Too Cool for...

Update III

David Jiles Ph.D.'s book is no longer available on the Lulu.com website. Another example of delete and hope the world will forget that I didn't do my homework. See here and here for more on this issue.

Let children play: From evolutionary psychology to creativity

Let children play: From evolutionary psychology to creativity

As a part of our ongoing series on creativity we recently spoke with Dr. Peter Gray, professor of Psychology at Boston College. Dr. Gray’s interest in creativity emerges as a consequence of his background in evolutionary psychology and interest in how humans (and...

The Postman always rings twice: Unpacking McLuhan (3/3)

The Postman always rings twice: Unpacking McLuhan (3/3)

This is the third of three blog posts about how media influence our thinking. This is the second of three blog posts about how media influence our thinking. The first post, uses the invention of writing and print to unpack the meaning of McLuhan’s statement, “The...

Social Media at Bloomfield Hills: The video

Back in November 2010, I had been invited by the Bloomfield Hills School District to speak to their administrators and leadership about issues related to social media and what it means for schools and districts. You can find out more about this session here. As I said...

TPACK & the moon OR why I love the web

I recently blogged (here and here) about the experiment conducted by students in Italy that allowed them to use publicly available NASA audio recordings from the moon landings to determine the distance between the earth and the moon. I bit more online research led to...

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *