Lab build

Product price prediction with frontier LLM fine-tuning

Predicts product prices from descriptions, comparing classic ML baselines, frontier LLMs and fine-tuned GPT-4o mini.

Role
Builder, end to end
Group
Fine-tuning
Services
AI & LLM systems

What it does

Amazon product data is scrubbed and curated into a balanced price dataset and uploaded to the Hugging Face Hub. A tester class scores every predictor by absolute price error, starting with random, linear regression, bag-of-words, SVR and Random Forest baselines and then GPT-4o mini and Claude prompts. GPT-4o mini is then fine-tuned through the OpenAI API from JSONL files, with the run tracked in Weights & Biases.

What was built

  1. 01

    Amazon product data is cleaned and balanced across price ranges, then pushed to the Hugging Face Hub.

  2. 02

    Tester class computes the absolute error of each prediction for every model.

  3. 03

    Baselines: random guesses, linear regression on engineered features, CountVectorizer bag-of-words, SVR and Random Forest.

  4. 04

    GPT-4o mini, GPT-4 and Claude are prompted for prices and scored with the same tester.

  5. 05

    JSONL training files launch an OpenAI fine-tuning job; training and validation loss are tracked in Weights & Biases.

The pipeline, layer by layer

Five layers, one pipeline.

  1. L1Data

    • Amazon product data
    • Curation and balancing
    • HF Hub dataset
  2. L2Baselines

    • Feature engineering
    • Linear, SVR, Random Forest
  3. L3Frontier

    • GPT-4o mini and Claude
  4. L4Fine-tuning

    • OpenAI fine-tuning job
    • W&B tracking
  5. L5Evaluation

    • Price error tester

Stack

  • pandas
  • scikit-learn
  • Hugging Face Datasets
  • Hugging Face Hub
  • OpenAI API
  • GPT-4o mini
  • Claude
  • Weights & Biases

Next lab build · 01 / 46

Medical RAG chatbot

Answers medical questions from a PDF knowledge base using FAISS retrieval and Mistral-7B.

Previous: QLoRA Llama 3.1 price predictor

Need a system like this in production? Tell us about it.