From 5804aad78f2670040120e103b9c1bc8caae2423c Mon Sep 17 00:00:00 2001 From: Siarhei Siniak Date: Thu, 29 Jul 2021 11:27:41 +0300 Subject: [PATCH] [~] Refactor --- python/tasks/mlb_player.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/python/tasks/mlb_player.py b/python/tasks/mlb_player.py index 40fd836..a4da458 100644 --- a/python/tasks/mlb_player.py +++ b/python/tasks/mlb_player.py @@ -1748,12 +1748,28 @@ def kernel_29(): def kernel_30(o_29, ids=None, delay=None,): t5 = o_29['t5'] + + if delay is None: + delay = 200 + if ids is None: numpy.random.seed(0) ids = numpy.random.choice( t5.index.shape[0], 10 ) + elif ids == 'v1': + ids = =numpy.random.choice( + numpy.where( + numpy.logical_and( + o_29['t5'].portion > 0.1, + o_29['t5'].mean_conf > 0.6 + ) + )[0], + 70 + ) + else: + assert isinstance(ids, numpy.ndarray) t7 = []