From d8074d5ead62370417100f7bfadb09837a1c5a8d Mon Sep 17 00:00:00 2001 From: Siarhei Siniak Date: Thu, 29 Jul 2021 22:20:14 +0300 Subject: [PATCH] [~] Refactor --- python/tasks/mlb_player.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/python/tasks/mlb_player.py b/python/tasks/mlb_player.py index 340f2d4..0920418 100644 --- a/python/tasks/mlb_player.py +++ b/python/tasks/mlb_player.py @@ -1810,6 +1810,20 @@ def kernel_30(o_29, ids=None, delay=None,): numpy.where(t8)[0], min(70, t8.sum()), ) + elif ids == 'v5': + t8 = numpy.stack( + [ + o_29['t5'].portion > 0.1, + o_29['t5'].min_conf > 0.5, + o_29['t5']['t8'].data > 0, + ], + axis=0 + ).prod(axis=0) + pprint.pprint([t8.sum(), t8.mean()]) + ids = numpy.random.choice( + numpy.where(t8)[0], + min(70, t8.sum()), + ) else: assert isinstance(ids, numpy.ndarray)