Skip to content

Repository files navigation

🌸 Machine Learning Product Performance Analysis

Author: Ashley Prado
Dataset: product_sales.csv


📘 Project Overview

This project analyzes supermarket product performance using machine learning techniques. It includes:

  • ✨ Full data preprocessing (missing values, outliers, normalization)
  • ✨ K-means clustering fully implemented from scratch
  • ✨ Regression modeling (Linear & Polynomial Regression)
  • ✨ Visualizations for non-technical users
  • ✨ A complete analytical write-up in REPORT.pdf

🛠️ Installation

Ensure Python 3.8+ is installed.

Install dependencies:

pip install pandas numpy matplotlib scikit-learn

Or with conda:

conda install pandas numpy matplotlib scikit-learn

▶️ How to Run the Project

1️⃣ Data Preprocessing

Handles missing values, outliers, and standardization.

python source_code/preprocessing.py

2️⃣ K-means Clustering (From Scratch)

Runs K-means for k = 2–8 and prints WCSS for the elbow method.

python source_code/kmeans_from_scratch.py

3️⃣ Cluster Analysis

Generates cluster statistics and saves results in the results/ folder.

python source_code/cluster_analysis.py

4️⃣ Visualizations

Creates the elbow curve and cluster scatter plot.

python source_code/visualization.py

5️⃣ Regression Models

Trains Linear & Polynomial Regression and saves evaluation plots.

python source_code/regression.py

📊 Key Findings

  • 🎯 Optimal cluster count: 4
  • 🔮 Best performing regression model: Polynomial Regression (degree 2)
  • 📉 Model Performance:
    • Linear Regression MAE ≈ 67.97
    • Polynomial Regression MAE ≈ 1.04

📄 Report

A full analytical explanation of preprocessing, clustering, regression, and interpretation is provided in:

REPORT.pdf

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages