Can ChatGPT write better code than Data Scientist?

Can ChatGPT write better code than Data Scientist? Artificial intelligence has made great strides in recent years and its applications in

Can ChatGPT write better code than Data Scientist? Artificial intelligence has made great strides in recent years and its applications in various fields have been growing. One such area is programming and coding. 

AI models such as OpenAI’s ChatGPT have been trained on a large corpus of text, including programming language syntax and coding practices. But can an AI language model like ChatGPT really write better code than a human data scientist?

Can ChatGPT write better code than Data Scientist

Can ChatGPT write better code than Data Scientist?

To start, let’s consider what a data scientist does. A data scientist is a professional who has a background in both computer science and statistics. 

They use their expertise in these fields to collect, analyze, and interpret large amounts of data to solve complex problems. 

They use programming languages such as Python, R, and SQL to perform tasks such as data cleaning, feature extraction, and model training. Data scientists also use various libraries and frameworks such as Pandas, Numpy, and TensorFlow to assist with these tasks.

On the other hand, ChatGPT is an AI language model trained to generate text based on input patterns. This includes generating code snippets based on a given problem statement. 

While ChatGPT has a vast knowledge of programming concepts and syntax, it does not have hands-on experience with real-world data and does not have the expertise to design and implement effective solutions to complex problems.

Let’s check the code-writing ability of ChatGPT:

First, I asked ChatGPT to write a code for getting summary statistics of the diabetes dataset.

 

Can ChatGPT write better code than Data Scientist?

Very Impressive, as after ChatGPT generates the correct code it also gives us a plain text explanation of what we should expect the code to do.

Task 1: Successful

Then, I asked the ChatGPT to write a code to plot the histogram of a dataset.

Can ChatGPT write better code than Data Scientist?

Can ChatGPT write better code than Data Scientist?

Again, it gave the correct code with an explanation. But when I asked it to generate the result it fails to do that as it doesn’t have the display plot capability. Instead, it suggested I should run the code on the local machine to get the result. I followed and here is the result of the code written by ChatGPT.

Can ChatGPT write better code than Data Scientist?

Task 2: Successful

To inspect further, I asked ChatGPT to explain the Random Forest model for diabetes prediction using eli5.

Can ChatGPT write better code than Data Scientist?

Can ChatGPT write better code than Data Scientist?

Although, the code fails to run as it missed some essential steps (which I’ll explain later). but still, the code is useful. It trained the Random Forest Regressor model, evaluate it, and used eli5 to explain the model using permutation importance.

Task 3: Failed

Finally, I asked it to write a Streamlit application for diabetes prediction.
Can ChatGPT write better code than Data Scientist?

Can ChatGPT write better code than Data Scientist?

Can ChatGPT write better code than Data Scientist?

Again, the code fails to run, but with just a couple of adjustments, it is working fine. I would say the generated code is still pretty useful. Some of the errors while running the code written by ChatGPT were:

Missing file “diabetes.csv” as this time it didn’t load the dataset from SKlearn.

Input contains Nan, infinity or a value too large for dtype(‘float32’) as it didn’t handle the Nan values.

X has 10 features, but RandomForestRegressor is expecting 8 features as input, this is because it trained the model with 8 features but passing 10 features to get the prediction.

Task 4: Failed

After correcting all the errors, the app looks like this:

Can ChatGPT write better code than Data Scientist?

Can ChatGPT write better code than Data Scientist?Can ChatGPT write better code than Data Scientist?

So, can ChatGPT write better code than a data scientist? The answer is no.

While ChatGPT can generate code snippets based on input patterns, it lacks the expertise and experience of a data scientist. 

A data scientist has a deep understanding of the problem they are trying to solve and knows how to design and implement effective solutions. 

They also have hands-on experience with real-world data and know how to handle real-world data issues such as missing values and outliers.

Moreover, a data scientist’s expertise goes beyond just coding. They also have knowledge of machine learning algorithms, data visualization, and communication skills. 

They can present their findings in a clear and concise manner, making it easy for stakeholders to understand the results and make data-driven decisions.

Conclusion

In conclusion, while AI models such as ChatGPT have made great strides in the area of programming and coding, they cannot replace the expertise and experience of a data scientist. 

A data scientist’s combination of computer science, statistics, and hands-on experience makes them a valuable asset in solving complex problems and driving data-driven decision-making. 

While ChatGPT can assist with coding tasks and provide suggestions, a human data scientist is still the best choice for developing and improving code.

About the Author

Be a person who challenges the future, not a coward who is safe in the comfort zone.

Post a Comment

Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.