Log_likelihood update - #1008
Log_likelihood update #1008
Conversation
This is a simple exploratory notebook that heavily expolits pandas and seaborn
Update with log_likelihood logistic_regression.py
There was a problem hiding this comment.
Do not create the variable ll, it is not an intuitive name so just return the result. The function is self explanatory. Of course, a docstring, doctests, and type hints would not hurt.
There was a problem hiding this comment.
return np.sum(target * scores - np.log(1 + np.exp(scores)))
|
|
||
| iterations += 1 # update iterations | ||
|
|
||
| for step in xrange(num_steps): |
There was a problem hiding this comment.
xrange() was removed in Python 3 so please use range() instead.
| scores = np.dot(X, weights) | ||
| predictions = sigmoid(scores) | ||
| if step % 10000 == 0: | ||
| print log_likelihood(X,Y,weights) # Print log-likelihood every so often |
There was a problem hiding this comment.
print() is a function in Python 3. --> print(log_likelihood(X, Y, weights))
|
|
||
| if iterations == max_iterations: | ||
| print ('Maximum iterations exceeded!') | ||
| print ('Minimal cost function J=', J) |
There was a problem hiding this comment.
Style: No space between print and (.
… wastage analysis from 1961-2013 (FAO).ipynb
ChillOrb
left a comment
There was a problem hiding this comment.
I have made some changes. Please review and i would appreciate you helping me.
* Add files via upload This is a simple exploratory notebook that heavily expolits pandas and seaborn * Update logistic_regression.py * Update logistic_regression.py * Rename Food wastage analysis from 1961-2013 (FAO).ipynb to other/Food wastage analysis from 1961-2013 (FAO).ipynb * Update logistic_regression.py * Update logistic_regression.py * Update logistic_regression.py * Update logistic_regression.py * Update logistic_regression.py * Update logistic_regression.py * Update logistic_regression.py

No description provided.