Image by author
Data visualization is a crucial skill for anyone working with data. But creating beautiful and informative data visualizations can be time-consuming and require specialized tools. That’s where ChatGPT comes in. With its latest updates, ChatGPT makes data visualization faster and easier than ever.
The latest update has significantly improved the ChatGPT experience. Now, instead of having to switch between different options like the original GPT-4, GPT4 with advanced analysis or DALLE-3, you simply need to type a message and ChatGPT will automatically interpret your request and generate the desired results.
Image from ChatGPT
In this blog post, we’ll explore how to instantly generate multiple data visualizations using plain English prompts. Thanks to ChatGPT’s advanced data analysis, there is no need to process the data or run Python code. We’ll look at simple bar and pie charts and then tackle more complex visualizations using real-world data sets.
In this part, we will write a simple message to generate graphics. The message includes data in the form of a Python dictionary.
Pie chart
Before creating a message, make sure you are using the GPT-4 model, as it is the only one that supports generating visualizations.
We will write a message to generate a pie chart visualization based on various nutrient data. Additionally, we have requested that ChatGPT use a lighter color scheme, as the default colors are quite bright.
Prompt: Generate a pie chart of values {"Vitamin A":5, "Vitamin B": 1, "Vitamin C": 4, "Water": 90} to keep the color combination light.
As you can see, we got great results.
If you want to see the Python code behind the display, you need to click on the terminal logo at the end of the output.
After that, a window will appear containing the source code that you can modify and run on your own. However, this step is not required, as ChatGPT will simply run the code and display the visualizations as images. You can save these images for your presentation or report.
bar talk
In the next part, we provide CO2 emissions data for the car and let ChatGPT do the magic.
Prompt: Generate a bar plot co2 emissions of values {"Car A":30, "Car B": 25, "Car C": 20}.
You’ve added the title, x and y tags, and ensured descending order. Perfect!!!
Instead of overly controlling ChatGPT’s output, you can ask it to create output independently, similar to various Python AutoViz libraries. By simply providing the data set and requesting a full exploratory data analysis to generate the necessary graphs for you to review.
In our case, we are providing you with a Customer purchasing trends Data set that offers valuable information about consumer behavior and purchasing patterns.
Prompt: Perform exploratory data analysis on customer shopping trends dataset and display only plots.
ChatGPT delivered fast results, processing and analyzing consumer trends in less than a minute, a task that normally takes me at least 30 minutes to code and execute.
You can improve results by providing follow-up prompts about the type of display you’re interested in.
Prompt: Improve the analysis by plotting a correlation chart, bar chart, pie chart, boxplot, and relplot.
If you want to see a complex multi-level visualization, you must specifically request it from ChatGPT.
Prompt: Use the dataset to plot various complex visualizations.
Data visualization plays a crucial role in model evaluation. In this section we will use the Diabetes Data Set from Kaggle and ask ChatGPT to train and evaluate multiple models. To take full advantage of ChatGPT’s capabilities, we will ask you to display a confusion matrix, precision recall, and a graph comparing different models.
Prompt: Multiple machine learning models should be trained using the target column "Outcome", and the resulting model evaluation visualization should include a confusion matrix, precision-recall, and model comparison chart.
It is evident that ChatGPT has performed exceptionally well. Although the models did not perform well on the data set, we are impressed with their fast and accurate data visualization capabilities. It can be used to quickly analyze data sets or answer questions during interviews or take-home tasks.
ChatGPT has revolutionized the way we can create data visualizations with ease. With its advanced data analysis capabilities, you can generate stunning and informative data visualizations in seconds using simple English prompts.
In this post, we have learned how ChatGPT can instantly produce various charts such as pie charts, bar charts, correlation matrices, and even complex visualizations like repeating charts on demand.
ChatGPT also exceeded expectations when asked to train machine learning models on the diabetes dataset and generate evaluation metrics and comparison graphs. The entire process of creating and viewing the model took just one minute.
Whether you need a simple bar chart, advanced model analysis, or just a quick way to understand data sets, ChatGPT delivers exceptional results with minimal effort. With capabilities improving every day, it’s an exciting time to improve your data visualization skills using this ai assistant.
Abid Ali Awan (@1abidaliawan) is a certified professional data scientist who loves building machine learning models. Currently, he focuses on content creation and writing technical blogs on data science and machine learning technologies. Abid has a Master’s degree in technology Management and a Bachelor’s degree in Telecommunications Engineering. His vision is to build an artificial intelligence product using a graph neural network for students struggling with mental illness.