Creating metrics for risk.

Hi, we assume that a financial company decides to analyze the risk of lending money to employees of a particular company. we have the employee spreadsheet below.


Analyzing all the data of people who have already borrowed, it was perceived that the variables, type of employment, company time and loans already made were directly linked to the level of loan default. Based on this data we created the scoring and risk worksheet


 Type of employment, this variable indicates the stability of the employee, the smaller, more risk points he has, the weight of this variable and 3 because it is the most important for the payment of the loan.
The company time also influences the instability, this way the longer the company, the more security we have that the loan will be paid
and finally the amount of loans already made, the higher the amount the more sure we have that the payment will be made


Inserting the dataset into jupyter

Creating the functions for the risk variables:




Applying the functions to generate the columns of Risk per variable.
the .apply () function must be applied to the desired column, with the function to be executed as a parameter.


Gerando a coluna de risco  que e a media das 3 taxas de risco

Function for qualitative risk grouping
Applying qualitative grouping function and displaying in descending order


Generating qualitative risk information.

Creating a dataset with employees less likely to pay off the loan