Building a Scorecard
class Scorecard:
def __init__(self):
self.criteria = [
{"name": "Credit Score", "weight": 0.5},
{"name": "Income", "weight": 0.3},
{"name": "Bank Account History", "weight": 0.2}
]
def calculate_score(self, credit_score, income, bank_account_history):
score = 0
for criterion in self.criteria:
if criterion["name"] == "Credit Score":
score += criterion["weight"] * (credit_score / 850) # Assuming credit score range is 300-850
elif criterion["name"] == "Income":
score += criterion["weight"] * (income / 50000) # Assuming income range is up to $50,000
elif criterion["name"] == "Bank Account History":
score += criterion["weight"] * (bank_account_history / 5) # Assuming bank account history up to 5 years
return score
# Example usage
credit_score = 720
income = 35000
bank_account_history = 2
scorecard = Scorecard()
score = scorecard.calculate_score(credit_score, income, bank_account_history)
print("Score:", score)Last updated