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.


import creditprice as cp
import numpy as np
import pandas as pd
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)
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.

Files for creditprice, version 0.0.8
Filename, size File type Python version Upload date Hashes
Filename, size creditprice-0.0.8-py3-none-any.whl (5.7 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size creditprice-0.0.8.tar.gz (4.3 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page