regression predict logic