Building a simple linear regression model to predict the “Yearly Amount Spent” by customers using the free version of ChatGPT
When using the free version, it’s important to give ChatGPT a clear description of the dataset first, which serves as an effective approach to generating code, followed by user evaluation. ChatGPT is already trained very well on Python and a machine learning algorithm; hence, we do not need to provide specific steps here. To verify that the generated code functions correctly, we will be using Google Colab.
Feature 1: Building the model step by step
Let’s craft our initial prompt for the classification model.
[Prompt]
I want to create a simple linear regression model to predict the “Yearly Amount Spent” (TAG 1.1) by customers for the e-commerce customers dataset which consists of the following columns (PIC 2.3):
- Email: The electronic mail unique to each customer, used here as an identification...