all preds must be between 0 and 1 ( 0 < pred < 1 ) for the cost function not to return infinity or nan
( 0 < pred < 1 )