Skip to content

Commit

Permalink
Merge pull request #30 from numerai/ndharasz/between-0-1
Browse files Browse the repository at this point in the history
check that predictions are between 0 and 1
  • Loading branch information
ndharasz authored Sep 12, 2023
2 parents 799a1ae + 255137b commit 821999b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,11 @@ def main(args):
elif predictions.isna().any().any():
logging.error("Pickle function returned at least 1 NaN prediction")
exit_with_help(1)
elif not (predictions.between(0, 1).all().all()):
logging.error(
"Pickle function returned invalid predictions. Ensure values are between 0 and 1."
)
exit_with_help(1)
except TypeError as e:
logging.error(f"Pickle function is invalid - {e}")
if args.debug:
Expand Down

0 comments on commit 821999b

Please # to comment.