Multi cost calculation and gradient descent for multiples features