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.

Topics related to this post: Essay

A few randomly selected blog posts…

Brevity is the soul

I had posted earlier (see Twittering a tale) about short, short fiction that is suddenly the rage. Matt Koehler just introduced me to another example of this new emerging genre: Six Word Memoirs. Check it out.

Article in WEF Global Information Technology Report

Everybody has heard of the  World Economic Forum (WEF) annual meeting in Davos, Switzerland. As Wikipedia says, "The meeting brings together some 2,500 top business leaders, international political leaders, selected intellectuals, and journalists to discuss the most...

Engineering education, past & future

Neeraj Buch and I were invited to talk to a group of engineering educators from India. This was a meeting organized by the College of Engineering and the Indo-US Collaboration for Engineering Education. The topic I spoke about was was Improving Engineering Education:...

Cool logos

I just came across this page of excellent logo designs. Some of the designs may need a moment or two to truly register. Check out 20 Unique and Creative Logo Designs. Here are couple of my favorites.

MSU EPET program wins national award!

The Educational Psychology and Educational Technology Program at Michigan State University is the recipient of the  2013 Best Practice Award for the Innovative Use of Technology awarded by the American Association of Colleges of Teacher Education (AACTE). This...

F*** Nuance: A reflection on TPACK and theorizing

F*** Nuance: A reflection on TPACK and theorizing

It is rare that one comes across an original journal article title that one HAS to click on and read. For instance, my favorite title of all time has been Alison Gopnik's article titled "Explanation as Orgasm." Not only is this a catchy title, it also make a profound...

Jared Diamond on creativity, innovation and wealth

Jared Diamond has an article on edge.org, somewhat provocatively titled: How to get rich? The question his after is simply, "what is the best way to organize human groups and human organizations and businesses so as to maximize productivity, creativity, innovation,...

NEW BOOK! Creativity, Technology & Education

NEW BOOK! Creativity, Technology & Education

I am thrilled to announce the publication of a new book, a Mishra-Henriksen production titled Creativity, Technology & Education: Exploring their Convergence.  This book is a collection of essays that first appeared the...

0 Comments

Submit a Comment

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