← 📊 Data Science

🔤 Vectorizer Lab

idf("the"):
tf-idf("the", positive):
Signal / stopword ratio:
FPS:
Drag — rotate · Scroll — zoom

🔤 Bag-of-Words vs TF-IDF

A 3D bar chart of term weights across negative, neutral and positive tweets, comparing raw Bag-of-Words counts against TF-IDF weighting so you can see exactly which words a TF-IDF classifier learns to trust.

🔬 What It Demonstrates

Bag-of-Words treats every occurrence equally, so filler words like "the", "amp" and "http" tower over sentiment-bearing words. TF-IDF multiplies each count by an inverse-document-frequency term, shrinking ubiquitous words and preserving rare, class-distinctive ones.

🎮 How to Use

Toggle between Bag-of-Words and TF-IDF, highlight a sentiment class, and drag the document-frequency and corpus-size sliders to see how the idf formula reshapes the bar for "the" in real time.

💡 Did You Know?

The "signal / stopword ratio" stat approximates why TF-IDF often beats plain Bag-of-Words on short, noisy text: it boosts the ratio of sentiment signal to boilerplate noise without any extra model complexity.