Logistic Regression Flashcards
(6 cards)
Steps in logistic Regression
- Desing an appropriate function for y based on x
- and build a probabilistic model for p(y|x)
- Determine parameters of the function
Step 1
Determine an appropriate function that maps the data to a class
y_pred=f(x)=σ(z) with z=w^Tx
Step 2
For example p(y=1|x;theta)=f(x)
p(y=0|x;theta)=1-f(x)
Or as Bernoulli
Step 3
Determine parameters of the function
-> maximize the likelihood function
L(theta)=p(Y|X,theta)
And build the log likelihood
What is a problem of the log-likelihood derivative?
It does not lead to a closed form solution.
Solution: iterative non-linear optimization with gradient descent
theta = argmin L(theta)
theta := theta-alpha*l(theta)
What training algorithm is being used?
Stochastik gradient Descent
function SGD(D, alpha):
Initialize theta with a small random value
repeat
for d=1 to m do:
theta <- theta + alpha*delte_theta
end for
until change of theta is small
return theta
end function