What I Built
Built a machine learning system to predict Amazon product physical length from text metadata using a multi-embedding ensemble. Combined 4 sentence-transformer embeddings (MiniLM, MPNet, DistilUSE, E5-Small) with FAISS KNN retrieval features and product-type embeddings in a PyTorch Lightning neural network.
What I Learned
Train for what you’re measured on. Switching from Huber loss (94% MAPE) → direct MAPE optimization (59%) → MAPE with log-target transform (51.78%) reduced error by 42 percentage points. Also discovered that KNN retrieval features (“products described similarly have similar lengths”) add consistent value — and post-processing predictions by snapping to valid lengths per product type gives ~1% free improvement.
Key Results
| Experiment | Loss | Val MAPE |
|---|---|---|
| Huber baseline | Huber | 94% |
| Direct MAPE | MAPE | 59% |
| MAPE + log-target | MAPE | 51.78% |
Final score: 48.22 (competition metric = 100 × (1 − MAPE))
Project
Tech Stack: PyTorch Lightning, Sentence Transformers (4 models), FAISS, Weights & Biases | Model: 4.1M params, ~20 min/epoch on T4 GPU
Citation
@online{prasanna_koppolu,
author = {Prasanna Koppolu, Bhanu},
title = {Product {Length} {Prediction}},
url = {https://bhanuprasanna2001.github.io/projects/product_length.html},
langid = {en}
}