From 24b253bd0101617432fc465cef9f2648d82f93d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E6=A3=AE?= Date: Tue, 25 Jan 2022 14:22:05 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E5=A4=84=E7=90=86=E5=B7=B2=E8=8E=B7?= =?UTF-8?q?=E5=88=A9=E6=81=AF=E5=80=8D=E6=95=B0=E4=B8=BANone=E7=9A=84?= =?UTF-8?q?=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Rating/scripts/financial_score.py | 43 +++++++++++++++++-------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/Rating/scripts/financial_score.py b/Rating/scripts/financial_score.py index e434ab9..6fd01b1 100644 --- a/Rating/scripts/financial_score.py +++ b/Rating/scripts/financial_score.py @@ -25,27 +25,30 @@ def financial_score(param1, param2): # main for key, value in param2.items(): - refer = list(map(float, refers[key])) - weight = weights[key] - if value is None: - score = 0 - elif value > refer[0]: - score = weight - elif value > refer[1]: - standard_score = round(weight * 1, 2) - score = linear_correlation_type(value, standard_score, refer[0], refer[1]) - elif value > refer[2]: - standard_score = round(weight * 0.8, 2) - score = linear_correlation_type(value, standard_score, refer[1], refer[2]) - elif value > refer[3]: - standard_score = round(weight * 0.5, 2) - score = linear_correlation_type(value, standard_score, refer[2], refer[3]) - elif value > refer[4]: - standard_score = round(weight * 0.25, 2) - score = linear_correlation_type(value, standard_score, refer[3], refer[4]) + if key == '已获利息倍数' and value is None: + scores[key] = 5 else: - score = 0 - scores[key] = round(score, 2) + refer = list(map(float, refers[key])) + weight = weights[key] + if value is None: + score = 0 + elif value > refer[0]: + score = weight + elif value > refer[1]: + standard_score = round(weight * 1, 2) + score = linear_correlation_type(value, standard_score, refer[0], refer[1]) + elif value > refer[2]: + standard_score = round(weight * 0.8, 2) + score = linear_correlation_type(value, standard_score, refer[1], refer[2]) + elif value > refer[3]: + standard_score = round(weight * 0.5, 2) + score = linear_correlation_type(value, standard_score, refer[2], refer[3]) + elif value > refer[4]: + standard_score = round(weight * 0.25, 2) + score = linear_correlation_type(value, standard_score, refer[3], refer[4]) + else: + score = 0 + scores[key] = round(score, 2) result = dict()