0
votes

So I'm having a hard time conceptualizing how to make mathematical representation of my solution for a simple logistic regression problem. I understand what is happening conceptually and have implemented it, but I am answering a question which asks for a final solution.

Say I have a simple two column dataset denoting something like likelihood of getting a promotion per year worked, so the likelihood would increase the person accumulates experience. Where X denotes the year and Y is a binary indicator for receiving a promotion:

X | Y
1   0 
2   1
3   0
4   1
5   1
6   1

I implement logistic regression to find the probability per year worked of receiving a promotion, and get an output set of probabilities that seem correct. I get an output weight vector that that is two items, which makes sense as there are only two inputs. The number of years X, and when I fix the intercept to handle bias, it adds a column of 1s. So one weight for years, one for bias.

So I have two few questions about this. Since it is easy to get an equation of the form y = mx + b as a decision boundary for something like linear regression or a PLA, how can similarly I denote a mathematical solution with the weights of the logistic regression model? Say I have a weights vector [0.9, -0.34], how can I convert this into an equation?

Secondly, I am performing gradient descent which returns a gradient, and I multiply that by my learning rate. Am I supposed to update the weights at every epoch? As my gradient never returns zeros in this case so I am always updating.

Thank you for your time.

1
What exactly is the programming problem you are facing? - mkrieger1
I am trying to figure out how to represent my weights as an equation / solution for the problem. - JakeBarger

1 Answers

0
votes

The logistic regression is trying to map the input value (x = years) to the output value (y=likelihood) through this relationship: where theta and b are the weights you are trying to find.

The decision boundary will then be defined as L(x)>p or <p. where L(x) is the right term of the equation above. That is the relationship you want.

You can eventually transform it to a more linear form like the one of linear regression by passing the exponential in numerator and taking the log on both sides.