ap307 / logistic_regression_example

0 stars 0 forks source link

Logistic regression #1

Open amirziai opened 7 years ago

amirziai commented 7 years ago

Is the pretty_ad_output = np.exp(pretty_ad_output) line correct?

amirziai commented 7 years ago

Take a look at: https://www.wikiwand.com/en/Logistic_regression https://github.com/tpeng/coursera-ml-python/blob/master/03-logistic-regression.ipynb https://gist.github.com/vietjtnguyen/6655020

ap307 commented 7 years ago

From the wiki reference, assumed that the probabilities should be normalized by dividing by sum of exp(beta dot x) of other features. Normalization was meant to occur in the next line of code.

amirziai commented 7 years ago

Since we have more than 2 classes here there are a few different ways that this can be done:

and the scikit-learn material here: http://scikit-learn.org/stable/modules/multiclass.html

The default implementation is OvR. See if this helps in understanding what's going on: https://gist.github.com/amirziai/c1ead66bc0492a729de0406d2a413651