← 🤖 Machine Learning

📊 BoW vs TF-IDF

Vectorisation mode
Highlight common words
idf("the"):
idf("great"):
idf("dull"):
FPS:
Drag — rotate · Scroll — zoom

📊 Bag of Words vs TF-IDF

A 3D bar chart grid — one row per document, one column per vocabulary word — lets you switch between raw Bag-of-Words counts and TF-IDF weighted scores, and watch common words collapse as the simulated corpus grows.

🔬 What It Demonstrates

Bag-of-Words treats every occurrence equally, so filler words like "the" tower over rare, meaning-carrying words. TF-IDF multiplies each count by an inverse-document-frequency weight, shrinking common words and boosting distinctive ones.

🎮 How to Use

Toggle between Bag-of-Words and TF-IDF, pick which document to highlight, and drag the corpus-size slider to see how adding more documents pushes down the idf weight — and bar height — of common words in real time.

💡 Did You Know?

TF-IDF was introduced by Karen Spärck Jones in 1972 and still underlies many production spam filters and search-ranking systems today, decades before deep learning embeddings existed.