Text Classification, LDA, KNN, SVM, Neural Networks, and FastText
摘要
This chapter moves from “group and guess” to label and predict. You build an end-to-end supervised text-classification pipeline: clean text ? vectorize (DTM/TF-IDF)? train/validate (CV) ? test ? interpret with confusion-matrix metrics. You try classic and modern models—linear discriminant analysis (LDA), k-nearest neighbor (KNN), support vector machine (SVM) (linear/radial basis function (RBF)/poly), neural nets (nnet via caret), plus a fast, practical workhorse: FastText. You also cover hyper-parameter tuning, class imbalance (accuracy vs. precision/recall/F1), and ensembling (stacking) to squeeze extra performance. Throughout, the use case is brand classification from product reviews and how results translate into marketing actions (auto-routing emails, segmenting feedback, monitoring brands).