Andrew Ng idea of finishing the job machine learning

EX2

For logistic regression - solving classification
first dividing line can be seen from the drawing monohydric or dihydric
Here Insert Picture Description
Here Insert Picture Description
because binary classification, if direct prediction is multiplied by a function of θ x -y this does not guarantee that only the value 0 and 1. Thus by a change, add outside g, so that it is greater than the 0-1 range between 0.5 to less than 0.5 to 1 0
That is, if xθ, he is greater than 0, y is 1 then predict, if xθ is smaller than 0, y = 0 then predict

The nature of the loss function, use the log function, as predicted punishment is 0, predict the opposite of punishment infinite
Here Insert Picture Description
h (theta) is the number you predict
Here Insert Picture Description
to quantify show
y * log () ** is the dot product

Derivation loss function
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description

Published 39 original articles · won praise 6 · views 10000 +

Guess you like

Origin blog.csdn.net/poppyl917/article/details/95374515