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…

The role of Vitamin D in beta-cell function

Who says scientists can't have fun. I just discovered a series of videos on (where else) YouTube about scientists expressing their doctoral research through dance!!! What can be cooler than that? Check out one of the winners: The role of Vitamin D in beta-cell...

How artists work

An interesting (and growing) collection of "habits, rituals and small (and occasionally big) methods people and teams use to get their work done. And in the specific anecdotes and the way people describe their own relationship to their own work." Kind of cool and...

Jugaad, India-genous creativity

Jugaad is a Hindi word which does not have a straight forward equivalent in English. I guess the closest phrase I would say would be "situational or indigenous creativity," the ability to make do creatively with the tools/resources one has at hand. On Jugadu.com I...

Complicating the idea of Design Thinking (in Education)

Complicating the idea of Design Thinking (in Education)

“Design thinking” is one of the latest buzzwords in education. Proponents argue that design thinking is a tried and tested process for fostering innovation in education while critics suggest that it is the latest fad to sweep through, and will, like others before it,...

Design is for life

Quote for the day: Parents look at their children today when they are 3 years old and say "Oh god!, He doesn't know how to operate the computer! How is he going to go ahead like this?" They should instead be worried if their child doesn’t know design. They should say,...

Tech Trends, Special Issue on TPACK

TechTrends is a leading journal for professionals in the educational communication and technology field and is the official publication of the Association for Educational Communications and Technology (AECT). The current issue has 5 articles devoted to the TPACK...

The end of the university II

From my end of the university as we know it series, here is another article, this time from The Washington Monthly, titled College for $99 a Month: The next generation of online education could be great for students—and catastrophic for universities. Here are some key...

William Kamkwamba, TED talk

I had written a couple of days ago about William Kamkwamba, a Malawian high school student who built a windmill by looking at pictures in a book. From Bob Reuter's website (Keep IT Simple!) I discovered a TED talk that William had given in England, back in July....

Palindromic poetry: Falling Snow

A few weeks ago I had written about an email that I received from an eighth grader in Colorado. Jake, a budding poet, was interested in learning more about me in the context of some palindromic poetry I had written many years ago. I wrote back to Jake (you can see the...

0 Comments

Submit a Comment

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