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…

Number (non)sense & flatulence!

Number (non)sense & flatulence!

Numbers are a gas! (Image credit: Phillie Casablanca) Numbers are seen as being critical to developing our understanding of a subject. As Lord Kelvin, (1824-1907) said: ... when you can measure what you are speaking about, and express it in numbers, you know something...

The joy of learning: Of fire and trees and Dr. Feynman

Trees are some of the largest living things in the world. They can weigh tons. For instance the  One Oak Tree project measured and weighed a 222 year old Oak tree - and it's weight was 14.4 Tonnes (3.86 tonnes of which was dry weight). That's a lot of stuff! And this...

Kuala Lumpur & Penang

I love Malaysia. I love its greenery, its up and down hilly landscape, the colors and designs of the houses, and yes the food. Malaysians are food crazy. There are food stalls everywhere and the range and variety of food available is just amazing. My first night here...

Visual wit

I just stumbled upon this website of witty and original t-shirt designs. Two of my favorites are "Experimental music" (included below) and "Puzzled Putter." You can see all the designs here.

There is no app for that

Ideas.TED.com has a new article titled—There's no app for good teaching: 8 ways to think about tech in ways that actually improve the classroom. It quotes a bunch of scholars and researchers, one of whom is yours truly. I am just posting this, for the record. Image...

Creativity in the lives of accomplished teachers

How do exemplary teachers incorporate creativity in their teaching? In this dissertation study, Danah Henriksen  interviewed National Teacher of the Year award winners (and finalists), to better understand their beliefs, interests, and practices involving creative...

Photoshopping in the cloud

Cloud computing maybe the next big thing. Google Apps and Chrome, gmail and flickr, YouTube and Yahoo Groups, I am moving more and more of what I do online. Even this blog in some way is an example of how I archive my work on the net. And today I discovered Pixlr....

Arriving in Malaysia

I am currently in Kuala Lumpur, arrived here last night, after spending a night at Delhi. I stayed with my old high-school buddy (Hartosh) and his wife, Paminder. We spent a nice evening chatting and catching up – since a lot had happened since we had last met, not...

0 Comments

Submit a Comment

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