skill~180 mindifficulty

Text Classification

Classification (spam, topic, sentiment) is the workhorse NLP task and the fastest way to turn text features into something useful.

1

Learn it

You will combine your preprocessing and TF-IDF/embedding features with classifiers like logistic regression or linear SVM in scikit-learn, then evaluate with a train/test split, a confusion matrix, and F1. You will learn to read a classification report and address imbalance.

By the end you’ll be able to

  • Build an end-to-end classifier from vectorized text
  • Evaluate with accuracy, precision/recall, F1; diagnose imbalance

Free resources

2

Practice

Train a logistic-regression classifier on a labelled review dataset and report a confusion matrix plus per-class F1.

3

Build it — your output

A trained baseline classifier with an evaluation report and 3 misclassified examples you analyze.

4

Prove it — check yourself

You’re ready to move on when you can honestly say yes to each:

  • Explain precision vs. recall for an imbalanced class
  • Justify your train/validation/test split choices
  • Interpret a confusion matrix to spot the worst class

Do it with AI

Use a free AI tool as your tutor and pair-programmer. Copy a prompt below into Claude, ChatGPT, or Gemini (for building, try Cursor or Copilot).

The habit: Try it yourself first — a little struggle is where the learning actually happens. Then ask for a hint before the answer — never copy blindly.

  • Understand itClaude / ChatGPT / Gemini

    I'm a beginner learning "Text Classification". Explain it in simple terms with a real-world analogy, then ask me ONE question to check my understanding — don't reveal the answer.

  • PracticeClaude / ChatGPT / Gemini

    Give me 3 short practice problems on "Text Classification" (my goal: build an end-to-end classifier from vectorized text), from easy to hard. Don't include the solutions yet — I'll try them first, then ask you to check.

  • Get unstuckClaude / ChatGPT / Gemini

    I'm stuck on this exercise about "Text Classification": [paste your attempt here]. Give me ONE small hint to move forward — do NOT give me the full solution.

  • Build & reviewCursor / Copilot

    Here is my work for a "Text Classification" task: [paste your code or answer]. Review it: point out what's wrong and WHY, and suggest improvements — but let me make the fixes myself.

  • Prove itClaude / ChatGPT / Gemini

    Quiz me on "Text Classification". Ask me 5 questions one at a time, wait for my answer each time, then tell me if I'm right and briefly why.

My notes