Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Logistic Regression Cost Function

  1. Jul 5, 2012 #1
    I am studying logistic regression and gradient ascent and have seen it used with a cost function and without one. Could anyone tell me why you would use a cost function? It seems just as effective without one.

    alpha = .05

    h = data * weights
    error = labels - sigmoid(h)
    weights = weights + alpha * data * error

    At this point I would think I can just loop through the above code and break when "error" converges. However, I've also seen code where you would pass "weights" to a cost function and break when the cost function converges. Please let me know if you need more information from me. Thanks
  2. jcsd
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Can you offer guidance or do you also need help?
Draft saved Draft deleted