Tabular Regression
Scikit-learn
Joblib
English
linear-regression
e-commerce
customer-analytics
spending-prediction
Instructions to use Srikanth-Karthi/ecommerce-spending-predictor with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Scikit-learn
How to use Srikanth-Karthi/ecommerce-spending-predictor with Scikit-learn:
from huggingface_hub import hf_hub_download import joblib model = joblib.load( hf_hub_download("Srikanth-Karthi/ecommerce-spending-predictor", "sklearn_model.joblib") ) # only load pickle files from sources you trust # read more about it here https://skops.readthedocs.io/en/stable/persistence.html - Notebooks
- Google Colab
- Kaggle
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
# Download and load model
model_path = hf_hub_download(
repo_id="Srikanth-Karthi/ecommerce-spending-predictor",
filename="model.joblib"
)
model = joblib.load(model_path)
# Predict
features = [[33.0, 12.0, 37.0, 3.5]]
# [Avg Session Length, Time on App, Time on Website, Membership Years]
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}
}
- Downloads last month
- -