make predict work with affine