Classification 1 Flashcards
Perceptron
Error-driven learning approach similar to logistic regression
Decision rule: wTx > 0
Gradient update (if incorrect):
- true pos: w <- w+x
- true neg: w <- w-x
- each training instance per update
Loss
Classification can be viewed as minimizing loss.
Online Optimization
Gradient over randomly sampled example
Batch Optimization
Gradient over entire dataset. Inefficient over large training sets
Mini-batch Optimization
Each time, calculating gradients from small subsets of examples. Most commonly used now
Regularization
Keeping weights small to prevent overfitting. Ex: applying L2-norm penalty to all weights
Evaluation
Calculates precision, recall, and accuracy using number of true/false positives and true/false negatives
Precision Equation
precision = tp / (tp+fp)
Recall Equation
recall = tp / (tp+fn)
Accuracy Equation
accuracy = precision + recall = (tp+tn) / (tp+fp+tn+fn)
Generative Models
- probabilistic models of P(x,y)
- compute P(y|x) by PREDICTING argmax y P(y|x) to classify
Discriminative Models
- model P(y|x) directly by COMPUTING argmax y P(y|x)
Naive Bayes
- generative model
- computes P(y|x) by PREDICTING argmax y P(y|x) to classify