Adapted prediction to new API.