Potential cost function

costFunction computes the log-likelihood and gradient given a vector of
weights,  the training data and labels.
Tutorial file test