Shen Shen
Feb 23, 2024
(some slides adapted from Tamara Broderick and Phillip Isola)
Hypothesis class
Hyperparameters
If/how to add regularization
Objective (loss) functions
Compute/optimize
new
input \(x\)
new
prediction \(y\)
Testing
(predicting)
Recap:
- OLS can have analytical formula and "easy" prediction mechanism
- Regularization
- Cross-validation
- Gradient descent
(The demo won't embed in PDF. But the direct link below works.)
(The demo won't embed in PDF. But the direct link below works.)
Recall: (Vanilla) Linear Classifier
Linear Logistic Regression
probabilistic interpretation
Comments about sigmoid
e.g. suppose, wanna predict whether to bike to school.
with given parameters, how do I make prediction?
1 feature:
2 features:
training data:
😍
🥺
training data:
😍
🥺
Comments about \(J_{lr} = \frac{1}{n} \sum_{i=1}^n \mathcal{L}_{\text {nll }}\left(\sigma\left(\theta^{\top} x^{(i)}+\theta_0\right), y^{(i)}\right)\)
How to represent class labels?
Suppose \(K\) classes, then it's convenient to let y be a \(K\)-dimensional one-hot vector
Generalize sigmoid to softmax
Generalize NLL to NLL multi-class (NLLM, or just cross-entropy)
Every data point incur a scalar loss:
two classes
\(K\) classes
scalar
scalar
\(K\)-by-1
\(K\)-by-1
We'd love it for you to share some lecture feedback.