Skip to content

Instantly share code, notes, and snippets.

@ducnh1022
Last active March 31, 2016 14:32
Show Gist options
  • Save ducnh1022/2bc3393535bf1b71557f2a2ba271f05e to your computer and use it in GitHub Desktop.
Save ducnh1022/2bc3393535bf1b71557f2a2ba271f05e to your computer and use it in GitHub Desktop.
Classification Week 1 - Linear classifier and logistic regression
Purpose
Data -> classifier -> intelligence
Input x -> sentence sentiment classifier -> y (positive or negative)
App:
Spam filtering
image classification
Impact of classification
Course overview
models: linear classifier, logistic regression, decision trees, ensembles
algorithms: gradient, stochastic gradient, recursive greedy, boosting
core ML concept: alleviating overfitting, missing data, precision recall, online learning
Linear Classifiers: use training data to learn a weight or coefficient for each word
Intuition
Scoring a sentence
output is weighted sum of input
Decision Boundary
Class probability
link function: suqeeze real line into 0..1 => generalize model
Logistic regression
sigmoid function => sigmoid score = 1/(1+exp(-score))
find best classifier = maximize quality metric over all possible w0 w1 w2
Encoding categorical inputs
Multiclass classification
1 versus all => +1 for 1 class and -1 for the rest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment