title: Why the cost function of logistic regression has a logarithmic expression?
body: <p>cost function for the logistic regression is</p>
  
  <pre><code>cost(h(theta)X,Y) = -log(h(theta)X) or -log(1-h(theta)X)
  </code></pre>
  
  <p>My question is what is the base of putting the logarithmic expression for cost function .Where does it come from? i believe you can't just put "-log" out of nowhere. If someone could explain derivation of the cost function i would be grateful. thank you.</p>