1
0 Comments

Building A Linear Regression Model That Predicts Retail Customer Spending

Hello everyone,

We have a new user on the platform NarrativeText.co called Lewis Carroll, who has deployed a new notebook called "Building A Linear Regression Model That Predicts Retail Customer Spending"... it is very interesting, here you can find an excerpt:

"We will create a complete project trying to predict customer spending using linear regression with Python.

In this exercise, we have some historical transaction data from 2010 and 2011. For each transaction, we have a customer identifier (CustomerID), the number of units purchased (Quantity), the date of purchase (InvoiceDate) and the unit cost (UnitPrice), as well as some other information about the purchased item.

We want to prepare this data for a regression of 2010 customer transaction data against 2011 expenses. Therefore, we will create features from the 2010 data and calculate the target (the amount of money spent) for 2011.

When we create this model, it should generalize to future years for which we do not yet have the result. Therefore, we could use 2020 data to predict 2021 spending behavior in advance, unless the market or business has changed significantly since the time period to which the data used to fit the model refers:"

Here you can find the dataset and notebook ready to download and learn from it: https://www.narrativetext.co/lewis-vs-data/building-a-linear-regression-model-that-predicts-retail-customer-spending

Hope you enjoy it!

posted to
Data Science
on March 2, 2021
Trending on Indie Hackers
I've built a 2300$ a month SaaS out of a simple problem. 20 comments Where can I buy newsletter ad promos? 12 comments 🔥 Roast My Landing Page 12 comments How would you monetize my project colorsandfonts? 8 comments How I built my SaaS in 2 weeks using NextJS and Supabase 6 comments Key takeaways growing MRR from $6.5k to $20k for my design studio 6 comments