Natural Language Processing · free preview
Text Classification with Logistic Regression
Supervised classification setup, hand-built features, the sigmoid and the logit, and vectorized scoring of many documents at once.
1. Text Classification with Logistic Regression
Text Classification with Logistic Regression
2. The sigmoid turns a score into a probability
The sigmoid turns a score into a probability
3. Scoring three reviews in NumPy
Scoring three reviews in NumPy
4. The sigmoid of a logit
Compute and round to three decimal places.
5. Scoring a document by weighted sum
A binary sentiment classifier has weights applied to the feature vector and bias . Compute the logit .
6. Reading the decision boundary
A binary classifier outputs as . With the standard threshold, which class does the classifier predict, and which condition explains it?
7. The logit as log odds
Compute the logit of , that is , and round to three decimal places.
8. Shapes in vectorized scoring
A test set stacks documents as rows of , each with features. With a weight vector and bias vector (one entry per document), the vectorized form is . How many probability values does contain? Answer with the number.
Practice this interactively
Free account · instant grading · spaced review that schedules itself.
Start this course for free