SkyAICampus
HomePracticeLearnCode LabFocus

Learn

HomePracticeConcept cardsCode LabSky Tutor

Review

Revise todayMistake notebookProgress

Focus

Campus ForestFocus roomsSquads

Questions or feedback?
support@skyaicampus.com

Keyboard shortcuts

  • Choose an answer1–4 or A–D
  • Check, then next questionEnter
  • Next hintH
  • Search cardsCtrl K

How this quiz adapts

3 fast right answers in a row: the next questions get harder. 2 wrong in a row: a little easier.

Hints and guesses still count, just a little less, so use them whenever you're stuck.

Sky Tutor

Stuck on an idea? Ask in your own words, or by voice.

Ask Sky Tutor
SkyAICampus
PrivacyTermssupport@skyaicampus.com© 2026 SkyAI Campus

New skill. A one-minute read first, then the question.

60-second card

Bag of words and TF-IDF

Bag-of-words counts each word in a document. TF-IDF also lowers the weight of words that appear everywhere.

  • TF = count of the word ÷ words in the document.
  • IDF = log(documents ÷ documents containing the word).
  • Word order is lost: 'dog bites man' = 'man bites dog'.
import math
tf = 2 / 10                  # 2 times in a 10-word document
idf = math.log10(100 / 10)   # in 10 of 100 documents
print(round(tf * idf, 2))

Prints

0.2

Remember: TF-IDF + logistic regression is a strong, cheap baseline.

Common mistake: Expecting bag-of-words to understand meaning or word order.

Log inSign up