Represents the probability that an item falls into a classification group.
Wrap the linear hypothesis:
$$ h_\theta(x) = g(\theta^Tx) $$
It is wrapped in the Sigmoid function:
$$ g(z) = \frac{1}{1 + e^{-z}} $$
The complete equation is:
$$ h_\theta(x) = \frac{1}{1 + e^{-\theta^Tx}} $$
The sigmoid function graph shows that it stays between $y=0$ and $y=1$.
Vectorizing the sigmoid function is done as follows in MATLAB:
function g = sigmoid (z)
g = 1 ./ (1 + e .^ -z);
end
These are all element-wise operators, since the end goal is to have an item for each element. Finally, you can simply do:
sigmoid(X * theta)
Which will give you the result of the hypothesis on each entry of X.