Monotonic Binning for Credit Rating Models
Project description
monobinpy
The goal of the monobinpy package is to perform monotonic binning of numeric risk factor in credit rating models (PD, LGD, EAD) development. All functions handle both binary and continuous target variable. Missing values and other possible special values are treated separately from so-called complete cases. This is replica of monobin R package.
Installation
To install pypi.org version run the following code:
pip install monobinpy
and to install development (github) version run:
pip install git+https://github.com/andrija-djurovic/monobinpy.git#egg=monobinpy
Example
This is a basic example which shows you how to solve a problem of monotonic binning of numeric risk factors:
import monobinpy as mb
import pandas as pd
import numpy as np
url = "https://raw.githubusercontent.com/andrija-djurovic/monobinpy/main/gcd.csv"
gcd = pd.read_csv(filepath_or_buffer = url)
gcd.head()
res = mb.sts_bin(x = gcd.age.copy(), y = gcd.qual.copy())
res[0]
res[1].value_counts().sort_index()
Besides above example, additional five binning algorithms are available. For details and additional description please check:
help(mb)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for monobinpy-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f2c0e75a48bfe5c92c6bef7516c47c9bc39e3b53d50dbadbc0c0511dac618318 |
|
MD5 | 0de8352b84b38c85b47ff3394afcb9e3 |
|
BLAKE2b-256 | c101f2536162e84a311aed4f2ddba658e7e2605e9f24ed0da9912a08fb9b7582 |