01Chapter 1: The task: assigning labels to documentsYou should know basic Python, including lists, loops, and function calls. You should also understand the difference between a training set and a test set in supervised learning. Basic NumPy and pandas usage helps, but this chapter does not require either library.3 min read
02Chapter 2: From raw text to tokensThis chapter assumes basic Python, familiarity with training and test sets, and a general understanding of supervised learning. You should also be comfortable reading regular expressions, which are patterns used to find text.2 min read
03Chapter 3: Bag-of-words and the document-term matrixThis chapter assumes basic Python, NumPy, and supervised learning. You should know that a training set contains examples and labels, and that a test set measures performance on unseen examples.3 min read
04Chapter 4: TF-IDF: weighting terms by how informative they areAssume you know basic Python, training and test sets, sparse matrices, and logarithms. This chapter explains how term frequency–inverse document frequency (TF-IDF) turns documents into numeric features for a machine-learning model.3 min read
05Chapter 5: N-grams, min_df, and controlling vocabulary sizeThis chapter assumes basic Python, supervised learning, and the idea that a training set must be kept separate from evaluation data. It also assumes you have seen TF-IDF and sparse matrices. We will focus on how a vectorizer decides which text patterns become features.3 min read
06Chapter 6: Logistic regression on sparse featuresThis chapter assumes basic Python, NumPy, and supervised learning. You should know that a training set teaches a model and that a test set measures it on examples the model did not see. You should also be comfortable with TF-IDF vectors and the idea of a feature.3 min read
07Chapter 7: Regularization and choosing CAssume you know the basics of supervised learning, training and test sets, TF-IDF features, and logistic regression. This chapter focuses on how regularization controls model complexity and how to choose the logistic regression parameter C.2 min read
08Chapter 8: Putting it together in a PipelineThis chapter assumes that you know basic Python, training and test splits, NumPy-style arrays, and the purpose of supervised learning. You should also know that text must be converted into numeric features before a machine-learning model can use it.2 min read
10Chapter 10: Tuning with cross-validation and grid searchAssume you know Python, training and test sets, basic NumPy, and the earlier TF-IDF and logistic regression workflow. This chapter focuses on choosing settings without accidentally using the test set during training.2 min read
11Chapter 11: Reading the model: which words drive each classAssume you know basic Python, NumPy, and supervised learning. You should also understand training and test sets, TF-IDF features, and logistic regression. This chapter focuses on interpreting a fitted scikit-learn model, not on proving that its explanations are causal.3 min read
12Chapter 12: When classes are unevenly representedAssume you know the basics of train/test splits, TF-IDF, logistic regression, and classification metrics. This chapter focuses on a common problem: one label appears much more often than another.2 min read
13Chapter 13: Limitations and where to go nextThis chapter assumes that you understand supervised learning, TF-IDF features, logistic regression, train/test splits, and common classification metrics. The TF-IDF and logistic regression workflow is a strong baseline, but it does not understand language in the way a person does.3 min read