Add hd_score_g2 support to Rules block
This commit is contained in:
parent
2cf9a2e5f9
commit
7aa04da902
4
block.py
4
block.py
@ -16,7 +16,8 @@ def __main__(
|
|||||||
email_cnt: int,
|
email_cnt: int,
|
||||||
rejected_app_count: float,
|
rejected_app_count: float,
|
||||||
app_dt_day_cnt: int,
|
app_dt_day_cnt: int,
|
||||||
hd_score_iso_m2: float
|
hd_score_iso_m2: float,
|
||||||
|
hd_score_g2: float
|
||||||
) -> dict:
|
) -> dict:
|
||||||
# Create a dictionary instead of using pandas DataFrame
|
# Create a dictionary instead of using pandas DataFrame
|
||||||
data = {
|
data = {
|
||||||
@ -28,6 +29,7 @@ def __main__(
|
|||||||
"rejected_app_count": rejected_app_count,
|
"rejected_app_count": rejected_app_count,
|
||||||
"app_dt_day_cnt": app_dt_day_cnt,
|
"app_dt_day_cnt": app_dt_day_cnt,
|
||||||
"hd_score_iso_m2": hd_score_iso_m2,
|
"hd_score_iso_m2": hd_score_iso_m2,
|
||||||
|
"hd_score_g2": hd_score_g2
|
||||||
}
|
}
|
||||||
|
|
||||||
final = processing(data)
|
final = processing(data)
|
||||||
|
|||||||
@ -10,6 +10,10 @@
|
|||||||
"type": ["number", "null"],
|
"type": ["number", "null"],
|
||||||
"description": "HD Fraud Score G1"
|
"description": "HD Fraud Score G1"
|
||||||
},
|
},
|
||||||
|
"hd_score_g2": {
|
||||||
|
"type": ["number", "null"],
|
||||||
|
"description": "HD Fraud Score G1"
|
||||||
|
},
|
||||||
"cluster_size_users_v2": {
|
"cluster_size_users_v2": {
|
||||||
"type": ["number", "null"],
|
"type": ["number", "null"],
|
||||||
"description": "Size of the user cluster in version 2."
|
"description": "Size of the user cluster in version 2."
|
||||||
|
|||||||
@ -10,6 +10,10 @@
|
|||||||
"type": ["number", "null"],
|
"type": ["number", "null"],
|
||||||
"description": "HD Fraud Score G1"
|
"description": "HD Fraud Score G1"
|
||||||
},
|
},
|
||||||
|
"hd_score_g2": {
|
||||||
|
"type": ["number", "null"],
|
||||||
|
"description": "HD Fraud Score G1"
|
||||||
|
},
|
||||||
"hd_score_s1": {
|
"hd_score_s1": {
|
||||||
"type": ["number", "null"],
|
"type": ["number", "null"],
|
||||||
"description": "HD Fraud Score S1"
|
"description": "HD Fraud Score S1"
|
||||||
|
|||||||
@ -50,6 +50,7 @@ def processing(data: dict) -> dict:
|
|||||||
"hd_score_s2": hd_score_s2,
|
"hd_score_s2": hd_score_s2,
|
||||||
"hd_score_s3": hd_score_s3,
|
"hd_score_s3": hd_score_s3,
|
||||||
"hd_score_iso_m2": data["hd_score_iso_m2"],
|
"hd_score_iso_m2": data["hd_score_iso_m2"],
|
||||||
|
"hd_score_g2": data["hd_score_g2"]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import unittest
|
import unittest
|
||||||
from block import __main__
|
from block import __main__
|
||||||
|
|
||||||
data = {'hd_score_m1': 1093.0, 'hd_score_g1': 0.0, 'cluster_size_users_v2': 1.0, 'target_connected_30_sum': 0.0, 'email_cnt': 1.0, 'rejected_app_count': 0.0, 'app_dt_day_cnt': 1.0, 'hd_score_iso_m2': 1001.0}
|
data = {'hd_score_m1': 1093.0, 'hd_score_g1': 0.0, 'cluster_size_users_v2': 1.0, 'target_connected_30_sum': 0.0, 'email_cnt': 1.0, 'rejected_app_count': 0.0, 'app_dt_day_cnt': 1.0, 'hd_score_iso_m2': 1001.0, "hd_score_g2": 0.0}
|
||||||
|
|
||||||
class TestBlock(unittest.TestCase):
|
class TestBlock(unittest.TestCase):
|
||||||
def test_main_success(self):
|
def test_main_success(self):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user