2 CONTENTS
2.4.1 Regularization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3531
2.4.2 Gradients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3632
2.5 Optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3733
2.5.1 Batch optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3734
2.5.2 Online optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3835
2.6 *Additional topics in classification . . . . . . . . . . . . . . . . . . . . . . . . 4036
2.6.1 Feature selection by regularization . . . . . . . . . . . . . . . . . . . . 4037
2.6.2 Other views of logistic regression . . . . . . . . . . . . . . . . . . . . . 4138
2.7 Summary of learning algorithms . . . . . . . . . . . . . . . . . . . . . . . . . 4239
3 Nonlinear classification 4740
3.1 Feedforward neural networks . . . . . . . . . . . . . . . . . . . . . . . . . . . 4841
3.2 Designing neural networks . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5042
3.2.1 Activation functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5043
3.2.2 Network structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5144
3.2.3 Outputs and loss functions . . . . . . . . . . . . . . . . . . . . . . . . 5245
3.2.4 Inputs and lookup layers . . . . . . . . . . . . . . . . . . . . . . . . . 5346
3.3 Learning neural networks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5347
3.3.1 Backpropagation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5548
3.3.2 Regularization and dropout . . . . . . . . . . . . . . . . . . . . . . . . 5749
3.3.3 *Learning theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5850
3.3.4 Tricks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5951
3.4 Convolutional neural networks . . . . . . . . . . . . . . . . . . . . . . . . . . 6152
4 Linguistic applications of classification 6953
4.1 Sentiment and opinion analysis . . . . . . . . . . . . . . . . . . . . . . . . . . 6954
4.1.1 Related problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7155
4.1.2 Alternative approaches to sentiment analysis . . . . . . . . . . . . . . 7256
4.2 Word sense disambiguation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7357
4.2.1 How many word senses? . . . . . . . . . . . . . . . . . . . . . . . . . 7458
4.2.2 Word sense disambiguation as classification . . . . . . . . . . . . . . 7559
4.3 Design decisions for text classification . . . . . . . . . . . . . . . . . . . . . . 7660
4.3.1 What is a word? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7661
4.3.2 How many words? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7962
4.3.3 Count or binary? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8063
4.4 Evaluating classifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8164
4.4.1 Precision, recall, and F -MEASURE . . . . . . . . . . . . . . . . . . . . 8165
4.4.2 Threshold-free metrics . . . . . . . . . . . . . . . . . . . . . . . . . . . 8366
4.4.3 Classifier comparison and statistical significance . . . . . . . . . . . . 8367
4.4.4 *Multiple comparisons . . . . . . . . . . . . . . . . . . . . . . . . . . . 8768
4.5 Building datasets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8869
Jacob Eisenstein. Draft of October 3, 2018.