As a result of recent advancements in generative AI, the field of Data Science is prone to various changes. This review critically examines the Data Analysis (DA) capabilities of ChatGPT assessing its performance across a wide range of tasks. While DA provides researchers and practitioners with unprecedented analytical capabilities, it is far from being perfect, and it is important to recognize and address its limitations.

§ INTRODUCTION

Machines have been key to the production of statistics since at least the 19th century. In a paper read before the Royal Statistical Society in 1894, Herman Hollerith introduced his invention, the `Tabulating Machine'. Prior to the use of this machine, it took about 10 years to process the collected data from the 1880 US Census so to arrive at a final report. Quoting [Hollerith, 1894]:
“While engaged in work in the tenth census, that of 1880, [...] I found, for example, that while we had collected the information regarding the conjugal condition of our 50 000 000 inhabitants, we were unable to compile this information even in its simplest form, so that, until the census of 1890, we never even knew the proportion of our population that was single, married, and widowed.”

The `Tabulating Machine' was able to process data recorded on punch cards, and thanks to it the 1890 census was completed in only 18 months and within a much smaller budget. Whereas a lot has changed since  Hollerith's invention, there was no turning back: The use of machines for handling and modeling data continued throughout the 20th century and has been increasing at a steep rate in the 21st century with the rise of AI.

This paper unveils the latest contribution to that space: ChatGPT's Data Analysis (DA) extension. We offer a comprehensive overview of its performance across various tasks. The walkthrough covers initiating the software and assessing its capabilities in exploring, visualizing, and extracting insights from data. ChatGPT's DA delivers a comprehensive toolbox for problem-solving via Python coding, supports operations with large memory requirements, and harnesses the strengths of LLMs (Large Language Models) [Mollick, 2023]. Also, it incorporates a Python interpreter into the ChatGPT environment for on-the-fly code execution, and to ensure maximum security all computing occurs within a firewall-protected sandbox.

While the usual disclaimers about LLMs—such as potential for hallucinations, biases, and occasional inaccuracies—remain relevant for DA, LLMs hold immense potential to become powerhouses within the statistical software landscape; indeed, the significant promise of LLMs in Data Science has been highlighted recently by [Tu et al., 2023]. In particular, DA enables even non-programmers to run code and obtain elaborate analyses. Despite significant progress, we argue that it is key to emphasize that no AI-powered statistical software should operate without human critique and oversight, nor should it be considered a complete substitute for the skills of a professional data analyst.

Both supervised and unsupervised learning tasks will be covered in this review;$^\dagger$[$^\dagger$Loosely, in supervised learning, the aim is to estimate the value of a certain outcome using several inputs (e.g., regression). In contrast, unsupervised learning lacks an outcome measure and instead seeks to identify the relationships within various inputs (e.g., cluster analysis).] for technical details on the methods covered here see [Murphy, 2022, Murphy, 2023]. A publicly available  price dataset from Kaggle [Kushwaha, 2023] is used for exploratory data analysis and visualizations, while the publicly available  dataset from the openintro R package [Çetinkaya Rundel et al., 2023] is employed for the modeling examples. While leading the conversation with DA, we primarily focused on simple prompts and on following the suggestions provided by DA.

The remainder of this paper unfolds as follows. We start with exploratory analyses and visualizations. The next sections are dedicated to supervised and unsupervised learning tasks. Lastly, the paper ends with some closing remarks. All statistical analyses and comments below in gray boxes, figures, and code were generated by DA. Throughout, we will use a star rating system to score statements and analyses produced by DA.

§ SEEING THROUGH DATA

§.§ Getting Started

To assess the strengths and weaknesses of ChatGPT's DA capabilities we start with the  dataset. This dataset is provided in the widely-used CSV format, enabling easy upload and prompt interaction with the DA console. Fig <ref> shows how the DA plugin can be activated within the ChatGPT interface.

ChatGPT window to turn on the Data Analysis feature.

After uploading the data, the user can immediately ask data analysis-related questions to the DA extension. In a seamless way, DA translates such queries into Python code and provides answers in text—after running the code under the hood.

§.§ Loading and Preprocessing Data

Loading a dataset in DA is as easy as dragging and dropping a CSV file into the console. Subsequently, DA assists in outlining the steps necessary for the planned analysis. The prompt “We have attached a dataset and we need to do some data analysis project with it. Can you create a report on this dataset?”
immediately led to an excellent list of tasks to follow:

[backgroundcolor=grey!20, linewidth = 0pt]
ChatGPT's DA 5

Great, we'll conduct the following analyses on your dataset:

* Descriptive statistics for numerical features.

* Distribution of laptops by company, type, and other categorical features.

* Price distribution and its relationship with other features.

* Analysis of the impact of TouchScreen, IPS display, and PPI on the price.

* The distribution of laptop features by operating system.

We will start with the descriptive statistics for the numerical features. Let's proceed with this analysis.
Here are the descriptive statistics for the numerical features in the dataset:

After producing a battery of summary statistics, DA suggested other steps such as:

[backgroundcolor=grey!20, linewidth = 0pt]

ChatGPT's DA $[$...$]$ 5
Next, we can look at the distribution of laptops by company, type, and other categorical features. Shall we proceed?

after which we answered “Yes.” This resulted in the automatic generation of Fig <ref>, which sets the stage for the subsequent discussion on visualizations in the next section.

data: Frequency per company, type, and CPU–GPU brands. 5

§.§ Data Visualization

One of the powerful aspects of the DA extension is that it excels at generating data visualizations and seamlessly executing successive analysis steps.

In our first visualization, shown in Fig <ref>, DA created a set of bar plots summarizing the frequency of laptops by company, type, and CPU–GPU brands. As a next move, DA suggested:

[backgroundcolor=grey!20, linewidth = 0pt]

ChatGPT's DA 5
$[$...$]$ look at the price distribution and its relationship with other features. Shall we continue with that analysis?

After we answered “yes," DA produced Fig <ref>; yet, it incorrectly suggested that prices are depicted on a log scale (cf  $x$-axis), whereas closer inspection of the raw CSV file revealed that this is misleading—as prices were actually depicted on the original scale. Finally, DA suggested and produced several other visualizations, including the boxplots in Fig <ref>, which summarized laptop specifications across different operating systems.

Histogram of  prices.

Side-by-side boxplots for  data.

To wrap up: With the exception of Fig <ref>, the DA plugin performed satisfactorily in terms of exploring and visualizing data. Next, we move to supervised learning.

§ LEARNING FROM SUPERVISED DATA

§.§ Warm-up

§.§.§ First Insights

In line with our strategy from the previous section, we aimed to keep the complexity of the prompts as simple as possible—by breaking down the analysis into smaller steps—and by following the suggestions provided by the DA response. We now consider the  dataset from the openintro R package. We kicked off with the question:
“We have attached a dataset and we need to do some data analysis project with it. Can you create a report on this data analysis for us?” Interestingly, the response below indicates that DA is aware of most variables' units—even though these were not detailed in the uploaded CSV file:
[backgroundcolor=grey!20, linewidth = 0pt]

ChatGPT's DA $[$...$]$ 5

* Unnamed: A seemingly redundant or index column.

* Address: Physical address of the property.

* Price: Sale price of the property.

* Bed: Number of bedrooms.

* Bath: Number of bathrooms.

* Area: The area of the property in square feet.

* Type: Type of property (e.g., Single Family).

* Year Built: The year in which the property was built.

* Heating: Type of heating system in the property.

* Cooling: Type of cooling system.

* Parking: Parking facilities available.

* Lot: Size of the lot in acres.

* HOA: Homeowners Association fees (if any).

* URL: URL for the property listing.

DA then continued the reply with a few suggestions for a data analysis:

[backgroundcolor=grey!20, linewidth = 0pt]

ChatGPT's DA $[$...$]$ 4

* Data Cleaning: Handle missing values, remove unnecessary columns, and correct data types if needed.

* Descriptive Statistics: Summarize the main features of the data.

* Price Analysis: Explore the distribution of property prices and how they relate to other features like area, bedrooms, etc.

* Property Type Analysis: Analyze different property types and their characteristics.

* Temporal Analysis: Look at the year of construction and its impact on price, if the data allows.

* Geographical Analysis: If the data on locations (address) is detailed enough, we can explore geographical trends.

* Correlation Analysis: Determine the relationships between different numerical features.

Some of these suggestions, such as Geographical Analysis, are not directly applicable due to data limitations; yet, DA acknowledges this possibility. Users can follow the suggested actions and create simple prompts—such as “Can you give us the descriptive statistics?”—after which DA successfully generates a variety of relevant summaries, including the frequency, mean, standard deviation, and min-max for the numerical variables. As a follow-up, we asked: “Can we get the correlation analysis for the dataset?” After this DA computed, among other things, the correlation between Price and Area, which is 0.67, suggesting a strong positive relationship (i.e., as the area of a property increases, its price tends to increase). It also offered some comments on the interpretation of correlation:

[backgroundcolor=grey!20, linewidth = 0pt]

ChatGPT's DA 3
The correlation analysis provides insights into how different numerical variables in your dataset are related to each other. The values range from -1 to 1, where:

* 1 indicates a perfect positive correlation (as one variable increases, the other increases).

* -1 indicates a perfect negative correlation (as one variable increases, the other decreases).

* 0 indicates no correlation.

DA is however silent regarding which correlation metric was actually computed. Indeed, the statistical literature encompasses a variety of correlation coefficients, such as Kendall's, Pearson's, and Spearman's correlations, with researchers continually developing new methods [Chatterjee, 2021]. After careful examination of the function executed in the background, we were able to confirm that it computed Pearson's correlation coefficient. Also, the reply by DA should perhaps have emphasized that: i) Pearson correlation only detects linear associations, not nonlinear ones; ii) correlation does not imply causality.

§.§.§ Modeling

Moving forward, we asked “We need to do a price analysis.” Following this prompt, DA generated various suggestions, without ever referring to modeling:

[backgroundcolor=grey!20, linewidth = 0pt]

ChatGPT's DA $[$...$]$ 4

* Price Distribution: Analyzing the overall distribution of prices to understand the range and common price points.

* Price Trends by Property Features: Investigating how price varies with different features like the number of bedrooms (bed), bathrooms (bath), area, lot size, and year built.

* Price Comparison by Heating and Cooling Types: Since different heating and cooling systems might affect property values.

* Geographical Price Trends: If the address data allows, we can explore how prices vary across different locations.

* Price Trends Over Time: If there's a timestamp associated with each sale (not apparent in the dataset), we could analyze how prices have changed over time.

To keep the conversation flowing, and for the sake of simplicity, we have opted for Price Distribution. The generated output produced some further sensible exploratory outputs (not shown) and indicated a potential next step:

[backgroundcolor=grey!20, linewidth = 0pt]

ChatGPT's DA 3

Next, let's look at the relationship between property price and other features such as the number of bathrooms, the area, and the lot size. Would you like to proceed with these analyses?

We answered “Yes, please proceed.” Although the output included interesting scatterplots—like price vs. area and price vs. lot size—it was disappointing that no algorithmic or statistical modeling was conducted at this stage. Hence, next we asked directly “Which type of modeling is suitable for this dataset?” This resulted in a long list of sensible models along with an opening remark:

[backgroundcolor=grey!20, linewidth = 0pt]

ChatGPT's DA 3

For this dataset, starting with a multiple linear regression model would be a good approach to understand the linear relationships between price and other variables. If the relationships are nonlinear or if there are significant interactions between variables, more complex models like random forests or gradient boosting machines might be more suitable.

Before proceeding with any modeling, it's important to ensure that the data is preprocessed correctly (handling missing values, encoding categorical variables, etc.) and to split the dataset into training and testing sets to evaluate the model's performance.

On the positive side, the initial portion of DA's response is sufficiently detailed for a novice to grasp the subsequent steps. Yet, it failed to critique the linear regression model, which could yield negative price predictions. Although this oversight might relate to the earlier incorrect assumption that prices were on a log scale, it remains an unfortunate lapse.

The remainder portion of DA's response includes suggestions that look reasonable at first glance, including regression analysis and its potential competitors—like neural network models:

[backgroundcolor=grey!20, linewidth = 0pt]

ChatGPT's DA $[$...$]$ 4

* Linear Regression Models$[$...$]$

* Decision Tree Regression $[$...$]$

* Random Forest Regression$[$...$]$

* Gradient Boosting Machines $[$...$]$

* Support Vector Machines (SVM) for Regression$[$...$]$

* Neural Networks $[$...$]$

Not all users may be familiar with these models, and it can be problematic if they are used without a proper understanding. Thus, it would be beneficial if DA could ask whether the user requires a reference, such as a textbook, to review the details of these methods or if they are already familiarized with them.

§.§ Regression, I: From Linear to Nonlinear Models

§.§.§ Linear Regression

For the rest of the conservation, some of the models earlier suggested by DA were implemented by prompting, “Can you implement a linear regression based on your suggestion?” The response offered a satisfactory roadmap of the analysis:

[backgroundcolor=grey!20, linewidth = 0pt]

ChatGPT's DA $[$...$]$ 4

* Preprocess the Data: Handle missing values, if any. Convert categorical variables into numerical formats, if necessary. Select relevant features for the regression model.

* Split the Data: Divide the data into training and testing sets.

* Build the Linear Regression Model: Train the model on the training set. Evaluate the model on the testing set.

* Model Evaluation: Assess the model's performance using metrics such as R-squared, Mean Absolute Error (MAE), Mean Squared Error (MSE), or Root Mean Squared Error (RMSE).

The reply is however silent on mainstream model diagnostics, such as the residual plots. Although these are discussed later, their relevance to linear regression models would warrant earlier mention.

Still, all in all, the starting steps seem reasonable recommendations for a novice learner. The created model used various predictors to construct a multiple linear regression model:

[backgroundcolor=grey!20, linewidth = 0pt]

ChatGPT's DA $[$...$]$4
We'll focus on numerical variables like `bed', `bath', `area', `year_built', and `lot' as predictors for `price'.

While the computations were interrupted due to an unexpected error in the platform, the provided code (not shown) implemented the methods accurately, and it could be directly pasted into Jupyter Notebooks or Google Colab [Bisong and Bisong, 2019].
Also, the resulting suggestions were informative and may be instructive for a novice learner:

[backgroundcolor=grey!20, linewidth = 0pt]

ChatGPT's DA $[$...$]$5

To improve the model, you might consider:

* Adding more relevant features, if available.

* Trying more complex models that can capture nonlinear relationships.

* Conducting feature engineering to derive new informative features.

§.§.§ Other Regression Models

Next, we asked “Can you to fit more complex models?” DA suggested the following models along with some brief justifications:

[backgroundcolor=grey!20, linewidth = 0pt]

ChatGPT's DA 4

* Decision Tree Regression: Can model complex, non-linear relationships.

* Random Forest Regression: An ensemble method that uses multiple decision trees.

* Gradient Boosting Regression: Builds trees one at a time, where each new tree helps to correct errors made by the previous one.

* Support Vector Regression (SVR): Can be used for both linear and non-linear data.

The previous response was completed as follows:

[backgroundcolor=grey!20, linewidth = 0pt]

ChatGPT's DA $[$...$]$3

* The SVR performed poorly with this dataset, as indicated by the negative $R^{2}$ value, which means it did worse than a simple average model.

* Given these results, the Random Forest Regressor seems to be the most suitable model for this dataset among the ones tested. It balances complexity and performance, handling the nonlinearities and interactions in the data effectively.

* Further improvements could be achieved by tuning the model's hyperparameters, feature engineering, or including additional relevant variables if available.

At first sight, it may seem surprising that SVR leads to a negative $R^{2}$ value, but it is well known that this can happen for nonlinear models. Quoting [Cameron and Windmeijer, 1997]:

“Application of this measure [$R^2$] to nonlinear models generally
leads to a measure that can lie outside the [0,1] interval and
decrease as regressors are added.”

While it is noteworthy that DA recognizes this,
it is disappointing that it uses $R^{2}$ as it is known that this is not the best option for nonlinear models [Cameron and Windmeijer, 1997, Spiess and Neumeyer, 2010].

§.§.§ Back to Linear Regression

In the following step, we asked “What about simpler linear models with a smaller number of predictors?” DA response provided some interesting comments on feature selection:

[backgroundcolor=grey!20, linewidth = 0pt]

ChatGPT's DA $[$...$]$5

* Univariate Analysis: Select features based on their individual correlation with the target variable.

* Backward Elimination: Start with all variables and iteratively remove the least significant until the best subset is found.

* Forward Selection: Start with no variables and iteratively add the most significant until the best subset is found.

While the suggestion was sensible from a model selection viewpoint, the computations were interrupted due to an unexpected error in the platform. We kept the conversation flowing by asking “Fit a simple regression model with one predictor only."

[backgroundcolor=grey!20, linewidth = 0pt]

ChatGPT's DA 4

* Given these options, `area' often serves as a primary indicator of property price in real estate markets. We'll proceed with creating a simple linear regression model using `area' as the sole predictor for `price.'

Apart from a few outputs on the fitted model (e.g., $R^2 = 0.398$), nothing was mentioned by DA about the  significance of the regression coefficients—nor even the values of the estimated coefficients themselves. After we asked “Create a model diagnostic results for the simple regression with area,” DA replied:

[backgroundcolor=grey!20, linewidth = 0pt]

ChatGPT's DA $[$...$]$ 5

* Residuals vs. Fitted Plot: To check for non-linearity, unequal error variances, and outliers.

* Normal Q-Q Plot: To assess if the residuals are normally distributed.

* Scale-Location Plot: To verify the homoscedasticity of residuals (equal variance across the range of predictors).

* Residuals vs. Leverage Plot: To identify influential data points.

and concluded with some sensible, yet shortsighted,   remarks:$^\dagger$[$^\dagger$For example, although the QQ plot of the residuals in Fig <ref> may suggest a lack of normality, bands are not shown, nor a normality test is conducted—such as the well-known Jarque–Bera test [Jarque and Bera, 1987].]

[backgroundcolor=grey!20, linewidth = 0pt]

ChatGPT's DA $[$...$]$ 3
These diagnostic plots suggest that while the model has some predictive power, there are violations of key assumptions like linearity, normality of residuals, and homoscedasticity. Such issues can affect the accuracy and reliability of the model's predictions. Exploring more complex models or transforming variables might help to address these issues.

Diagnostic plots for linear model for  data (response: price; predictor: area).

The same prompt led to Fig <ref> which is well conceived, apart from some minor aspects related with aesthetics—that could be easily edited in the raw Python code (e.g., labels outside of chart in the studentized residuals).

§.§ Regression, II: Deep Neural Network

In the next step, we asked “Can you implement a neural network model based on your suggestion?” DA wisely noted that:

[backgroundcolor=grey!20, linewidth = 0pt]

ChatGPT's DA 5
Implementing a neural network model for real estate data is a more advanced approach that can potentially capture complex, non-linear relationships in the data.

and it suggested:

[backgroundcolor=grey!20, linewidth = 0pt]

ChatGPT's DA $[$...$]$5

* Data Preprocessing:

* Scaling the features, since neural networks often perform better with normalized or standardized data.

* Using the same features (`bed', `bath', `area', `year_built', `lot') and target variable (`price').

* Building the Neural Network:

* We'll use a simple architecture with a few dense layers.

* Training the Network:

* Fit the model to the training data.

* Model Evaluation:

* Assess its performance on the test data.

Clearly, the sample size ($n = 98$) might be too small for such a highly parameterized model, but to see how DA would perform we proceeded anyway. The suggested steps look informative, but the computation resulted in an error:

[backgroundcolor=grey!20, linewidth = 0pt]

ChatGPT's DA $[$...$]$ 2
It appears that TensorFlow, the library typically used for building neural network models, is not available in this environment. As a result, I'm unable to implement and train a neural network model directly here.

Yet, despite this error, DA found a solution and kept the conservation flowing by adding some code suggestions as a draft to use in a separate  environment (e.g., Jupyter Notebooks), given below:

[backgroundcolor=grey!20, linewidth = 0pt]

ChatGPT's DA $[$...$]$ 3

However, I can guide you through the process of building and training a simple neural network for this task using TensorFlow and Keras in your own environment. Here's a basic outline of how you could do it:

[See Appendix A]

Too much was left to the user's interpretation; for instance, minimal guidance was given regarding the architecture, activation function, loss function, or the optimizer used to learn about the weights from data. On the positive side, code is well documented and the user can keep asking DA for further details and interpretations.

§ LEARNING FROM UNSUPERVISED DATA

In a separate session, we considered the implementation of unsupervised learning methods on the  dataset. We started with the question “Is the given data suitable for unsupervised learning?” The generated response was informative for the first step:$^\dagger$[$^\dagger$The response by DA could inadvertently suggest that unsupervised learning is not feasible in the presence of missing values, which is a misconception as evidenced by [Ilin and Raiko, 2010, Chi et al., 2016, Aschenbruck et al., 2023].]

[backgroundcolor=grey!20, linewidth = 0pt]

ChatGPT's DA 5

To determine if the provided data is suitable for unsupervised learning, I will first analyze the contents of the file you've uploaded. Let's begin by examining the data in `duke_forest.csv'. I'll check for:

* The nature of the data (numerical, categorical, etc.).

* The presence of any missing values.

* The overall structure and distribution of the data.

This analysis will help in understanding if the data is appropriate for unsupervised learning techniques such as clustering, dimensionality reduction, or anomaly detection. Let's take a look at the data now.

Also, potential use cases for unsupervised learning were nicely summarized as shown below:

[backgroundcolor=grey!20, linewidth = 0pt]

ChatGPT's DA $[$...$]$5

* Clustering: To group properties into clusters based on similar characteristics.

* Dimensionality Reduction: To reduce the number of features while retaining important information, possibly for visualization.

* Anomaly Detection: To identify unusual properties, which could be outliers in terms of price or other features.

Given this information, the dataset seems suitable for unsupervised learning with a few considerations:

* Preprocessing: Handle missing values and encode categorical features.

* Appropriate Algorithms: Depending on the goal (e.g., clustering, dimensionality reduction), different algorithms can be applied. For instance, $k$-means clustering might be used to group similar properties, while PCA (Principal Component Analysis) could be useful for dimensionality reduction.

* Feature Selection: Given the mixed data types, careful selection of features and preprocessing (like normalization for numerical features) will be important.

Among the different suggested algorithms we opted for clustering for the sake of illustration, and hence asked “Proceed by implementing $k$-means
clustering.” Next, DA automatically implements $k$-means clustering over a range of values and attempts to use the elbow method to determine an appropriate number of clusters ($k$). Supporting Information includes the Python code generated by DA to produce Fig <ref>.

Elbow method for  data.

Regarding the interpretation of the generated Elbow plot, shown in Figure <ref>, the interpretations were fairly reasonable:

[backgroundcolor=grey!20, linewidth = 0pt]

ChatGPT's DA 4

Next, we'll use the Elbow Method to determine an appropriate number of clusters ($k$) for $k$-means clustering. This method involves running the $k$-means clustering for a range of $k$ values and calculating the Sum of Squared Distances (SSD) for each $k$. The “elbow" point in the plot of SSD versus $k$ is considered as a good estimate for the number of clusters.

The Elbow Method plot shows the Sum of Squared Distances (SSD) for different numbers of clusters ($k$). In this plot, we are looking for a point where the SSD starts to decrease at a slower rate, forming an “elbow." However, the plot does not show a very clear “elbow," which can sometimes happen. In such cases, choosing the right number of clusters may require a bit of experimentation or may depend on additional domain knowledge or specific requirements

§ CLOSING REMARKS

In this paper, we have provided a review on how a data analysis can be conducted in ChatGPT's DA. The history of statistical software is extensive and multifaceted, with various aspects detailed in  [Chambers, 2017]. Despite its current limitations, GPT promises to become a key player in this landscape, and has the potential to augment traditional statistical tools, providing researchers and practitioners with unprecedented analytical capabilities.

Overall, the DA plugin can be useful for exploratory purposes. Yet, the modeling component requires a detailed understanding and the application of more specific prompts along with domain expertise. Without these, the generated outputs may be misleading. This is especially true for novice learners, for whom the use of such a tool without meticulous supervision could inadvertently hinder their learning process. On a positive note, the Python code generated in the background is largely reproducible, with only a few issues, and it definitely provides users with a solid starting point for further analysis.

In a well-known quote, world-renowned statistician Brian Ripley once claimed:
“Let's not kid ourselves: the most widely used piece of software for statistics is Excel.”

[Ripley, 2002].

Since then, modern statistical computing tools—such as Julia, Python, and R—have been taking over, but we might be reaching another paradigm shift. The interface between LLMs and statistical models has been effectively established by ChatGPT's DA plugin. Yet, as illustrated above, users should critically assess its recommendations and outputs.

§.§.§ Disclosure Statement

No potential conflict of interest was reported by the authors.

§.§.§ Data and Code Availability

The data sets are publicly available. All prompts are available upon request.

§.§.§ ORCID

Ozan Evkaya (https://orcid.org/0000-0002-5076-8144)
Miguel de Carvalho (https://orcid.org/0000-0003-3248-6984)

§.§.§ Funding

This work was supported by CIDMA under Grants: https://doi.org/10.54499/UIDB/04106/2020
and https://doi.org/10.54499/UIDP/04106/2020.

[Hollerith, 1894]
Herman Hollerith.
The electrical tabulating machine.
Journal of the Royal Statistical Society, 570 (4):0 678–689, 1894.

[Mollick, 2023]
Ethan Mollick.
What ai can do with a toolbox. getting started with code interpreter, 2023.
URL <https://www.oneusefulthing.org/p/what-ai-can-do-with-a-toolbox-getting?utm_campaign=post&utm_medium=web>.
Accessed: on June 2023.

[Tu et al., 2023]
Xinming Tu, James Zou, Weijie J. Su, and Linjun Zhang.
What should data science education do with large language models?
arXiv:2307.02792, 2023.

[Murphy, 2022]
Kevin P Murphy.
Probabilistic Machine Learning: An Introduction.
MIT press, Cambridge, MA, 2022.

[Murphy, 2023]
Kevin P Murphy.
Probabilistic Machine Learning: Advanced Topics.
MIT press, Cambridge, MA, 2023.

[Kushwaha, 2023]
Gyan Prakash Kushwaha.
Laptop Price Prediction cleaned Dataset: Dataset of Laptops, for Machine Learning regression problem, 2023.

[Çetinkaya Rundel et al., 2023]
Mine Çetinkaya Rundel, David Diez, Andrew Bray, Albert Y. Kim, Ben Baumer, Chester Ismay, Nick Paterno, and Christopher Barr.
openintro: Data Sets and Supplemental Functions from `OpenIntro' Textbooks and Labs, 2023.

[Chatterjee, 2021]
Sourav Chatterjee.
A new coefficient of correlation.
Journal of the American Statistical Association, 1160 (536):0 2009–2022, 2021.

[Bisong and Bisong, 2019]
Ekaba Bisong and Ekaba Bisong.
Google colaboratory.
Building Machine Learning and Deep Learning Models on Google Cloud Platform: A Comprehensive Guide for Beginners, pages 59–64, 2019.

[Cameron and Windmeijer, 1997]
A Colin Cameron and Frank AG Windmeijer.
An $r$-squared measure of goodness of fit for some common nonlinear regression models.
Journal of Econometrics, 770 (2):0 329–342, 1997.

[Spiess and Neumeyer, 2010]
Andrej-Nikolai Spiess and Natalie Neumeyer.
An evaluation of $r^2$ as an inadequate measure for nonlinear models in pharmacological and biochemical research: A monte carlo approach.
BMC Pharmacology, 100 (1):0 1–11, 2010.

[Jarque and Bera, 1987]
Carlos M. Jarque and Anil K. Bera.
A Test for Normality of Observations and Regression Residuals.
International Statistical Review, 55:0 163–172, August 1987.
ISSN 03067734.

[Ilin and Raiko, 2010]
Alexander Ilin and Tapani Raiko.
Practical approaches to principal component analysis in the presence of missing values.
Journal of Machine Learning Research, 11:0 1957–2000, 2010.

[Chi et al., 2016]
Jocelyn T Chi, Eric C Chi, and Richard G Baraniuk.
$k$-pod: A method for $k$-means clustering of missing data.
The American Statistician, 700 (1):0 91–99, 2016.

[Aschenbruck et al., 2023]
Rabea Aschenbruck, Gero Szepannek, and Adalbert FX Wilhelm.
Imputation strategies for clustering mixed-type data with missing values.
Journal of Classification, 400 (1):0 2–24, 2023.

[Chambers, 2017]
John M Chambers.
Extending R.
CRC Press, Boca Raton, FL, 2017.

[Ripley, 2002]
B.D. Ripley.
Statistical methods need software: A view of statistical computing.
Presentation RSS Meeting, September 2002; http://www.stats.ox.ac.uk/$\sim$ripley/RSS2002.pdf, 2002.

[Molenberghs et al., 2014]
Geert Molenberghs, Garrett Fitzmaurice, Michael G Kenward, Anastasios Tsiatis, and Geert Verbeke.
Handbook of Missing Data Methodology.
Chapman & Hall/CRC press, Boca Raton, FL, 2014.

[Little and Rubin, 2019]
Roderick JA Little and Donald B Rubin.
Statistical Analysis with Missing Data.
Wiley, New York, 2019.

[Hollerith, 1894]
Herman Hollerith.
The electrical tabulating machine.
Journal of the Royal Statistical Society, 570 (4):0 678–689, 1894.

[Mollick, 2023]
Ethan Mollick.
What ai can do with a toolbox. getting started with code interpreter, 2023.
URL <https://www.oneusefulthing.org/p/what-ai-can-do-with-a-toolbox-getting?utm_campaign=post&utm_medium=web>.
Accessed: on June 2023.

[Tu et al., 2023]
Xinming Tu, James Zou, Weijie J. Su, and Linjun Zhang.
What should data science education do with large language models?
arXiv:2307.02792, 2023.

[Murphy, 2022]
Kevin P Murphy.
Probabilistic Machine Learning: An Introduction.
MIT press, Cambridge, MA, 2022.

[Murphy, 2023]
Kevin P Murphy.
Probabilistic Machine Learning: Advanced Topics.
MIT press, Cambridge, MA, 2023.

[Kushwaha, 2023]
Gyan Prakash Kushwaha.
Laptop Price Prediction cleaned Dataset: Dataset of Laptops, for Machine Learning regression problem, 2023.

[Çetinkaya Rundel et al., 2023]
Mine Çetinkaya Rundel, David Diez, Andrew Bray, Albert Y. Kim, Ben Baumer, Chester Ismay, Nick Paterno, and Christopher Barr.
openintro: Data Sets and Supplemental Functions from `OpenIntro' Textbooks and Labs, 2023.

[Chatterjee, 2021]
Sourav Chatterjee.
A new coefficient of correlation.
Journal of the American Statistical Association, 1160 (536):0 2009–2022, 2021.

[Bisong and Bisong, 2019]
Ekaba Bisong and Ekaba Bisong.
Google colaboratory.
Building Machine Learning and Deep Learning Models on Google Cloud Platform: A Comprehensive Guide for Beginners, pages 59–64, 2019.

[Cameron and Windmeijer, 1997]
A Colin Cameron and Frank AG Windmeijer.
An $r$-squared measure of goodness of fit for some common nonlinear regression models.
Journal of Econometrics, 770 (2):0 329–342, 1997.

[Spiess and Neumeyer, 2010]
Andrej-Nikolai Spiess and Natalie Neumeyer.
An evaluation of $r^2$ as an inadequate measure for nonlinear models in pharmacological and biochemical research: A monte carlo approach.
BMC Pharmacology, 100 (1):0 1–11, 2010.

[Jarque and Bera, 1987]
Carlos M. Jarque and Anil K. Bera.
A Test for Normality of Observations and Regression Residuals.
International Statistical Review, 55:0 163–172, August 1987.
ISSN 03067734.

[Ilin and Raiko, 2010]
Alexander Ilin and Tapani Raiko.
Practical approaches to principal component analysis in the presence of missing values.
Journal of Machine Learning Research, 11:0 1957–2000, 2010.

[Chi et al., 2016]
Jocelyn T Chi, Eric C Chi, and Richard G Baraniuk.
$k$-pod: A method for $k$-means clustering of missing data.
The American Statistician, 700 (1):0 91–99, 2016.

[Aschenbruck et al., 2023]
Rabea Aschenbruck, Gero Szepannek, and Adalbert FX Wilhelm.
Imputation strategies for clustering mixed-type data with missing values.
Journal of Classification, 400 (1):0 2–24, 2023.

[Chambers, 2017]
John M Chambers.
Extending R.
CRC Press, Boca Raton, FL, 2017.

[Ripley, 2002]
B.D. Ripley.
Statistical methods need software: A view of statistical computing.
Presentation RSS Meeting, September 2002; http://www.stats.ox.ac.uk/$\sim$ripley/RSS2002.pdf, 2002.

[Molenberghs et al., 2014]
Geert Molenberghs, Garrett Fitzmaurice, Michael G Kenward, Anastasios Tsiatis, and Geert Verbeke.
Handbook of Missing Data Methodology.
Chapman & Hall/CRC press, Boca Raton, FL, 2014.

[Little and Rubin, 2019]
Roderick JA Little and Donald B Rubin.
Statistical Analysis with Missing Data.
Wiley, New York, 2019.

line above to use inline references.

§ SUPPORTING INFORMATION

§ APPENDIX A: SELECTED PYTHON CODES PROVIDED BY DA

§.§ A.1. Code for Fitting Neural Network Model

pip install tensorflow
import tensorflow as tf
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import train_test_split
from sklearn.metrics import mean_squared_error, r2_score

# Assuming X and y are your features and target variable

# Scale the features
scaler = StandardScaler()
X_scaled = scaler.fit_transform(X)
y_scaled = scaler.fit_transform(y.values.reshape(-1, 1))

# Split the data
X_train, X_test, y_train, y_test = train_test_split(X_scaled, y_scaled,

# Build the model
model = tf.keras.models.Sequential([
tf.keras.layers.Dense(128, activation='relu', input_shape=(X_train.shape[1],)),
tf.keras.layers.Dense(64, activation='relu'),
tf.keras.layers.Dense(32, activation='relu'),

# Compile the model
model.compile(optimizer='adam', loss='mean_squared_error')

# Train the model
model.fit(X_train, y_train, epochs=100, batch_size=10, verbose=0, validation_split=0.2)

# Evaluate the model
y_pred = model.predict(X_test)
mse = mean_squared_error(y_test, y_pred)
r2 = r2_score(y_test, y_pred)

print(f'MSE: mse, R-squared: r2')

§.§ A.2. Code for Reproducing Fig. <ref>

from sklearn.preprocessing import StandardScaler, OneHotEncoder
from sklearn.compose import ColumnTransformer
from sklearn.impute import SimpleImputer
from sklearn.pipeline import Pipeline
import numpy as np

# Selecting relevant features for clustering
features_to_use = ['price', 'bed', 'bath', 'area', 'year_built', 'lot', 'type', 'heating',
'cooling', 'parking']
data_clustering = data[features_to_use]

# Handling missing values
# Impute missing values in 'lot' with the median
# Drop `hoa' as it has too many missing values
data_clustering['lot'] = data_clustering['lot'].fillna(data_clustering['lot'].median())

# Categorical and numerical features
categorical_features = ['type', 'heating', 'cooling', 'parking']
numerical_features = ['price', 'bed', 'bath', 'area', 'year_built', 'lot']

# Creating a column transformer for preprocessing
preprocessor = ColumnTransformer(
('num', StandardScaler(), numerical_features),
('cat', OneHotEncoder(handle_unknown='ignore'), categorical_features)

# Applying the transformations
data_preprocessed = preprocessor.fit_transform(data_clustering)

# Checking the shape of the preprocessed data

from sklearn.cluster import KMeans
import matplotlib.pyplot as plt

# Range of k values to try
k_values = range(1, 11)

# List to store the sum of squared distances for each k
ssd = []

for k in k_values:
kmeans = KMeans(n_clusters=k, random_state=0)

# Plotting the Elbow Method graph
plt.figure(figsize=(10, 6))
plt.plot(k_values, ssd, marker='o')
plt.title('Elbow Method For Optimal k')
plt.xlabel('Number of clusters (k)')
plt.ylabel('Sum of Squared Distances')

§.§ Appendix B: Impact of Prompting

Posing questions in a more oriented way can have an impact on the analyses and recommendations. We illustrate this in a single prompt using again the  dataset. Generally, from our experience, the given outputs are more structured when prompts are strategically oriented—such as “Do necessary data cleaning if needed, and handle missing values:"

[backgroundcolor=grey!20, linewidth = 0pt]

ChatGPT's DA 3

Here's a summary of the data cleaning and validation steps:

* Data Structure and Missing Values:
The dataset contains 98 entries and 14 columns.
There is one missing value in the `lot' column.
The `hoa' column has 97 missing values out of 98 entries, indicating that it is largely empty and may not be useful for analysis.
There are no duplicate rows in the dataset.

* Removed Columns: The `Unnamed: 0' column, which was a redundant index, has been removed. The `hoa' column, which was largely empty, has also been removed.

* Missing Value Treatment: The missing value in the `lot' column has been imputed with the median value of that column.

Parenthetically, we underscore that the approach selected by DA to handle missing values (i.e., median imputation) is rather unsatisfactory from a statistical viewpoint. It is well known that methods such as stochastic regression imputation or multiple imputation offer more appropriate solutions to this issue [Molenberghs et al., 2014, Little and Rubin, 2019].

\begin{equation}
\xi _{ij}(t)=P(x_{t}=i,x_{t+1}=j|y,v,w;\theta)= {\frac {\alpha _{i}(t)a^{w_t}_{ij}\beta _{j}(t+1)b^{v_{t+1}}_{j}(y_{t+1})}{\sum _{i=1}^{N} \sum _{j=1}^{N} \alpha _{i}(t)a^{w_t}_{ij}\beta _{j}(t+1)b^{v_{t+1}}_{j}(y_{t+1})}}
\end{equation}

§.§.§ Headings: third level

§ EXAMPLES OF CITATIONS, FIGURES, TABLES, REFERENCES

§.§ Citations

Citations use . The documentation may be found at

Here is an example usage of the two main commands ( and ): Some people thought a thing <cit.> but other people thought something else <cit.>. Many people have speculated that if we knew exactly why <cit.> thought this…

§.§ Figures

[10]
See Figure <ref>. Here is how you add footnotes. [Sample of the first footnote.]
[11]

[-.5cm]4cm4cm [-.5cm]4cm0cm
Sample figure caption.

§.§ Tables

See awesome Table <ref>.

The documentation for  (`Publication quality tables in LaTeX') is available from:

Sample table title

Name         Description         Size ($\mu$m)

Dendrite     Input terminal      $\sim$100

Axon         Output terminal     $\sim$10

Soma         Cell body           up to $10^6$