Welcome to the Amazon Clothing Sales Linear Regression Analysis! This project dives into customer data to help decide whether to boost the mobile app or website experience for an online clothing store. Using powerful linear regression, we predict yearly spending and uncover key insights to supercharge business strategy! π
Amazon's clothing platform lets customers meet personal stylists in-store, then order online via mobile app or website. Our goal? Predict yearly spending and determine where to focus effortsβmobile app or websiteβusing data-driven insights from linear regression! π
- File:
output.csv - Features:
- Avg. Session Length: Time with stylists (float)
- Time on App: Mobile app usage time (float)
- Time on Website: Website browsing time (float)
- Length of Membership: Membership duration (float)
- Target: Yearly Amount Spent (float)
- Dropped: Email, Address, Avatar (non-numerical)
- Rows: 500 | Null Values: Zero! β
- Python 3.x π
- Libraries:
pandas: Data wrangling magicnumpy: Number-crunching powermatplotlib.pyplot: Stunning visualizationsseaborn: Sleek, stylish plotsscikit-learn: Machine learning mastery
- Install:
pip install pandas numpy matplotlib seaborn scikit-learn
- Import
output.csvinto a pandas DataFrame - Drop Email, Address, and Avatar for a lean dataset
- Peek at stats with
describe()andinfo() - Visualize with flair:
- π Jointplots: Time on Website vs. Spending, Time on App vs. Spending
- οΏ½ Hexbin Plot: Time on App vs. Length of Membership
- π Pairplot: All features at a glance
- π Linear Model Plot: Spending vs. Membership Length
- X: Features (Avg. Session Length, Time on App, Time on Website, Length of Membership)
- y: Target (Yearly Amount Spent)
- Split: 70% training, 30% testing (random_state=101)
- Fire up a
LinearRegressionmodel - Fit it to training data and reveal coefficients
- Predict spending on test data
- Scatterplot: Real vs. predicted values for a visual win!
- Model Coefficients:
- Avg. Session Length: ~26.33
- Time on App: ~38.53
- Time on Website: ~0.16
- Length of Membership: ~61.35
- Big Reveal:
- π Length of Membership rules spending!
- π± Time on App packs a punch (38.53) vs. Time on Website (0.16)
- Verdict: Focus on the mobile app for maximum impact! π
- Clone this repo:
git clone https://github.com/your-username/amazon-clothing-sales-analysis.git - Install dependencies:
pip install pandas numpy matplotlib seaborn scikit-learn - Place
output.csvin the project folder - Run the script and watch the magic unfold!
- Explore data
- Train the model
- Visualize predictions