E-commerce Spending Predictor

A Linear Regression model that predicts yearly customer spending based on user behavior metrics from an e-commerce platform.
Model Description
- Model Type: Linear Regression (scikit-learn)
- Task: Tabular Regression
- Language: Python
- License: Apache 2.0
Features
| Feature |
Description |
Avg. Session Length |
Average session length in minutes |
Time on App |
Time spent on mobile app in minutes |
Time on Website |
Time spent on website in minutes |
Length of Membership |
Years of membership |
Target Variable
Yearly Amount Spent - Total yearly spending in USD
Performance Metrics
| Metric |
Value |
| Mean Absolute Error (MAE) |
8.43 |
| Mean Squared Error (MSE) |
103.92 |
| Root Mean Squared Error (RMSE) |
10.19 |
Quick Start
from huggingface_hub import hf_hub_download
import joblib
model_path = hf_hub_download(
repo_id="Srikanth-Karthi/ecommerce-spending-predictor",
filename="model.joblib"
)
model = joblib.load(model_path)
features = [[33.0, 12.0, 37.0, 3.5]]
prediction = model.predict(features)
print(f"Predicted Yearly Spending: ${prediction[0]:.2f}")
Training Details
- Algorithm: Linear Regression
- Library: scikit-learn
- Train/Test Split: 70/30
- Random State: 42
Use Cases
- Customer lifetime value prediction
- Marketing budget allocation
- Customer segmentation
- Revenue forecasting
Limitations
- Model assumes linear relationships between features and target
- Trained on a specific e-commerce dataset (500 samples)
- May not generalize to different industries or customer bases
Citation
@misc{ecommerce-spending-predictor,
author = {Srikanth-Karthi},
title = {E-commerce Spending Predictor},
year = {2025},
publisher = {Hugging Face},
url = {https://huggingface.co/Srikanth-Karthi/ecommerce-spending-predictor}
}