Skip to main content

Credit price tool

Project description

#Introduction This package is used to create a suitable plan of credit price for different borrowers.As historical borrowers' credit score and loan interests are given, you can train a credit price model through this package, and this model will allow you to calculate a different, recommended loan interest for any borrower only based on his or her credit score.


#Example:

import creditprice as cp
#生成数据
import numpy as np
import pandas as pd
np.random.seed(123)
score = 650 + 100 * np.random.randn(1000)
price = 0.2 + 0.1 * np.random.randn(1000)
flag = np.random.randint(2, size=1000)
flagy = np.random.binomial(1, 0.2, size=flag[flag == 1].shape[0])
data = pd.DataFrame(columns=['score', 'r', 'accept', 'flagy'])
data['score'] = score
data['r'] = price
data['accept'] = flag
data.loc[data.accept == 1, 'flagy'] = flagy
#生成模型
cl = cp.calc(ld=0.5, d = 1, rl = 0.05, rf = 0.04, score='score', interest='r', flag='accept', y = 'flagy')
#计算利率表
r_table = cl.calc_r_table(data = data)
#根据data计算单利率
r = cl.calc_r(p=0.2, data=data)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

creditprice-0.0.8.tar.gz (4.3 kB view hashes)

Uploaded Source

Built Distribution

creditprice-0.0.8-py3-none-any.whl (5.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page