Natural Language Processing · 免费预览
用逻辑回归进行文本分类
监督分类设置、手工构造的特征、sigmoid函数与logit,以及对多篇文档同时进行向量化打分。
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.