Skip to content
··7 मिनट पढ़ने का समय

Data analysis के लिए ChatGPT और Code Interpreter जो कर सकते हैं वो देखकर मैं दंग रह गया

मैंने Treasury data के बारे में ChatGPT से "कुछ interesting बताओ" जैसे अस्पष्ट सवाल पूछे — और उसने instantly ऐसे insightful graphs बना दिए जिन्हें मैं manually बनाने में घंटों लगाता।

यह पोस्ट 2023 में लिखी गई थी। तब से कुछ जानकारी बदल सकती है।

जब Ethan Mollick ने लिखा कि chatGPT with Code Interpreter कितना powerful है, तो मेरी जिज्ञासा बहुत बढ़ गई। उस वक्त मैं छुट्टियों पर था इसलिए आज ही इसके साथ खेलने का मौका मिला। और भाई, यह मेरा दिमाग उड़ा देता है!

संदर्भ के लिए, मैंने Treasury Direct वेबसाइट से US government security issues के बारे में data का इस्तेमाल करने का फैसला किया। मैंने यह data set इसलिए चुना क्योंकि मैंने इससे पहले "Why You Shouldn't Believe the Hype About the TreasuryDirect Website Being Outdated" के बारे में एक blog post लिखी थी, इसलिए मैं dataset से कुछ हद तक परिचित हूँ। और सबसे ज़रूरी बात, मुझे मोटे तौर पर याद है कि graphs बनाने में मुझे कितना समय लगा था।

पूरे dataset को upload करना बेहद आसान है

बस एक click में, मैं पूरे dataset को data dictionary के साथ upload कर सकता हूँ। और मुझे dataset के बारे में ज़्यादा कुछ नहीं कहना पड़ा, बस वेबसाइट से ये वाक्य: "The Securities Issued in TreasuryDirect dataset details how many of each type of Treasury bonds are issued, redeemed, or outstanding in TreasuryDirect from Fiscal Year (FY) 2002 until present."

मुझे यह पसंद है कि बिना prompt किए, chatGPT मुझे बता देता है कि वो dataset को high level पर कैसे समझता है और initial rows का preview देता है।

अब मैं data से "बात" कर सकता हूँ

क्या आप इस dataset के बारे में कुछ interesting बता सकते हैं?

मैंने chatGPT से एक काफी अस्पष्ट सवाल पूछा: "can you tell me something interesting about this dataset?" यह एक super generic सवाल था क्योंकि मैं देखना चाहता था कि क्या chatGPT intuitively अनुमान लगा सकता है कि इंसानों को क्या interesting लग सकता है।

और यह रहा जवाब:

क्या आप इस dataset के बारे में कुछ interesting बता सकते हैं

क्या आप इस dataset के बारे में कुछ interesting बता सकते हैं

क्या आप इस dataset के बारे में कुछ interesting बता सकते हैं

जैसा कि आप देख सकते हैं, chatGPT ने सही अनुमान लगाया कि शायद समय के साथ gross sales amount का trend dataset के बारे में पहला interesting नोट है जो मुझे concern कर सकता है। फिर वो अगले chart में security type के हिसाब से gross sales को break down करता है। (अगर आप शब्दों और final chart के बीच ध्यान से देखें, तो आप देख सकते हैं कि chatGPT ने गलत color "orange" बोला जबकि वो "darker blue" था, लेकिन यह deal breaker नहीं है।)

अगला, मैंने chatGPT से एक और अस्पष्ट सवाल पूछा :P

"Based on this dataset, do you think that the website treasury direct is getting more popular?"

और मुझे जो जवाब मिला वो मुझे पसंद आया: "The popularity of the TreasuryDirect website could be inferred by examining the trends in sales and the number of transactions over time. If we see an increase in these metrics, it could suggest that more people are using the website to purchase Treasury bonds. However, it's important to note that this is a rough estimation and might not represent the full picture of the website's popularity, as there might be other factors at play."

मुझे यह जवाब इसलिए पसंद आया क्योंकि tone of voice सही है। ChatGPT clearly बताता है कि वो uncertain है और जवाब कई possible answers में से एक है।

यह graph है जो chatGPT ने generate किया:

समय के साथ transactions की संख्या chatGPT first try

Iteration ही key है

जबकि ऊपर के charts ठीक हैं, ये अभी वो final products नहीं हैं जो मैं ढूंढ रहा हूँ। तो मैंने chatGPT से कहा "I want to include the chart about the number of transactions over time on my blog, can you reformat the chart so that it is easier to read?"

और आप नीचे एक-एक करके समय के साथ सुधार देख सकते हैं:

पहला सुधार

मेरी request के बाद chatGPT ने यह reply किया:

Absolutely, I can modify the chart to make it easier to read. Some changes that could improve the chart's readability include:

  1. Title, labels और ticks का font size बढ़ाना।
  2. बेहतर visibility के लिए plot की linewidth adjust करना।
  3. एक अधिक descriptive title और labels जोड़ना।
  4. Gridlines को lighter बनाना ताकि distraction न हो।

और यह है chart:

पहला chart सुधार chatGPT

दूसरा सुधार

मुझे vertical axis में कुछ अजीब लगा तो मैंने कहा "for the vertical axis, I am not sure if my audience will understand what 1e6 means?"

और यह रहा result:

"Understandable, scientific notation can sometimes be confusing for a general audience. Instead, we can convert the y-axis labels to millions and add that information to the label. This way, the numbers will be more straightforward to understand. Let's make that adjustment."

TreasuryDirect transactions का time के साथ trend, y-axis fixed के साथ

तीसरा revision

ऊपर के chart को देखने के बाद मेरा response था: "yes this graph is getting much better! I notice from the trend that the number of transactions increased significantly over the past few years. How do we show this better to my audience?"

और chatGPT ने reply किया:

"One common method for highlighting trends in data over time is to include a trend line in the graph. A trend line (also called a line of best fit) is a line that is used to represent the behavior of a group of data to see if there's a certain pattern.

In the context of your data, adding a trend line can help visualize whether there's an overall increase in the number of transactions over time, despite any short-term fluctuations.

Let's add a trend line to the graph. We'll use a simple linear regression model to estimate the trend. We'll also include the equation of the trend line and the R-squared value (which measures how closely the data fit the regression line) in the graph's legend to provide more context for the audience."

तीसरा revision और chatGPT गलत हो गया

जबकि chatGPT का जवाब confident लगता है, आप देख सकते हैं कि ऊपर की chat में कोई red trend line नहीं है। तो मैंने feedback दिया।

चौथा revision

"I dont see the red line at all from the above chart"

और chatGPT ने reply किया:

"I apologize for the confusion. The red line representing the trend might not be visible due to the large fluctuations in the data. A trend line, especially for a linear regression model, may not adequately represent the data if there are large-scale fluctuations or if the trend is not linear.

An alternative way to highlight the trend could be to use a rolling mean (also known as a moving average). This technique averages out the fluctuations over a certain period to highlight the longer-term trend.

Let's apply a 12-month rolling mean to the data and plot it along with the original data. This should help us better visualize the overall trend."

trend line के साथ chatGPT chart revision

"A rolling mean short-term fluctuations को smooth out करता है और data में longer-term trends को highlight करता है। इस case में, इसे 12-month periods में transactions की संख्या को average करके calculate किया जाता है।

Rolling mean line monthly fluctuations के बावजूद data के general trend को दिखाती है। जैसा कि हम देख सकते हैं, transactions की संख्या में एक clear upward trend है, जो आपकी इस observation का समर्थन करता है कि TreasuryDirect more popular हो रहा है।"

क्या यह great नहीं है? मैंने chatGPT को नहीं बताया था कि मैं 12-month rolling mean देखना चाहता हूँ लेकिन उसने खुद ही suggest किया। सच में, मैंने इस तरह पिछले कुछ सालों में बड़े बदलाव को पिछले 20 सालों की तुलना में visualize करने के बारे में नहीं सोचा था। फिर से super impressed!

आप color का चुनाव भी नोटिस करेंगे, trend line के लिए purposely एक darker color इस्तेमाल किया जो change को highlight करता है, जो मैं चाहता था।

Final revision

जबकि मैं पिछले chart से पहले से impressed था, मैंने यह जोड़ा: "actually, one additional question, do we need the gridlines for the above chart? do you think we can simplify the chart further by eliminating the gridlines?"

और यह मुझे वापस मिला:

chatGPT का final chart revision

इस revision process को पढ़कर आपको लग सकता है कि यह बहुत लंबा चल रहा है लेकिन नहीं, real life में हर iteration run होने में 5-10 seconds से कम लगते हैं। यह निश्चित रूप से मेरे खुद करने से बहुत तेज़ है!

मेरे अपने chart और chatGPT के chart के बीच सीधी तुलना

जैसा कि ऊपर बताया, मैंने पहले इस dataset का इस्तेमाल करके एक blog post लिखी थी तो मैंने पहले कुछ charts खुद बनाए थे। अब मैं देखना चाहता था कि वही chart फिर से बनाना chatGPT का उपयोग करके कितना तेज़ होगा।

तो मैंने लिखा "can you generate a graph to show the trend of funded account at treasury direct from Jan 2016 to Feb 2023?"

मेरे अपने chart और chatGPT के बनाए chart को side-by-side देखते हैं। नीचे मेरे द्वारा खुद बनाया हुआ chart है:

TreasuryDirect पर Funded accounts का trend January 2016 से February 2023

अगर मुझे सही याद है, तो इससे पहले यह chart बनाने में मुझे 5-10 मिनट से ज़्यादा लगे थे।

लेकिन chatGPT के साथ, इसमें seconds लगे और यह मिला (bonus 12-month rolling mean के साथ)। आप judge करें कि कौन सा version बेहतर है :P

chatGPT with code interpreter का revised chart

निष्कर्ष

Data analysis के लिए chatGPT with code interpreter अभी जो कर सकता है उससे मैं दंग रह गया और भविष्य में और improvements के साथ यह क्या कर सकेगा, यह देखने का इंतज़ार है :D

आप regularly जो सबसे tedious data task करते हैं वो क्या है? क्या आपने उसे Code Interpreter पर throw करने की कोशिश की है? मुझे जानना है कि क्या यह आपके domain-specific data को उतनी ही अच्छी तरह handle करता है जितनी अच्छी तरह मेरा किया।

शुभकामनाओं सहित, Chandler

पढ़ना जारी रखें

मेरा सफ़र
जुड़ें
भाषा
सेटिंग्स