Spooky Sale: 10% off Premium yearly · $118.80 for the first year · until Nov 6Get it

Deep-ML
Learn
Problems1,200+ hands-on ML problemsLearning PathA guided route through the fundamentalsLabsInteractive labs on real techniquesProjectsBuild a GPT, an RL agent, CUDA kernelsCollectionsCurated problem sets and videosMathPen-and-paper math for MLIntuitionInvent the idea behind the formula yourselfPlaylistsYour own problem lists, shareableStudy AssistantAn AI teacher that knows your progress
Interview Prep
Compete
ContestsFresh problem sets, ranked liveLeaderboardWhere you stand, globallyBuddiesSolve with a friend: streaks, a weekly board, chat
Discuss
Deep-Path
Premium
      Intuition
      20 of 88

      Which words matter?

      You’re building search over a library of documents. Some words say what a document is about; others are just glue. Write importance(times_in_doc, docs_with_word, total_docs): how important one word is to one document. times_in_doc is how often this document uses the word, docs_with_word how many documents in the library use it at all, and total_docs how many documents there are.

      an article about plants, in a library of 100 articles
      times_in_docdocs_with_wordtotal_docs
      the30100100
      leaf620100
      chlorophyll42100
      solution.pyLoading Python
      ← Colors into numbersThe tenth mention →