Skip to main content

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


Download files

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

Source Distribution

monobinpy-0.0.1.tar.gz (12.6 kB view details)

Uploaded Source

Built Distribution

monobinpy-0.0.1-py3-none-any.whl (19.7 kB view details)

Uploaded Python 3

File details

Details for the file monobinpy-0.0.1.tar.gz.

File metadata

  • Download URL: monobinpy-0.0.1.tar.gz
  • Upload date:
  • Size: 12.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.10

File hashes

Hashes for monobinpy-0.0.1.tar.gz
Algorithm Hash digest
SHA256 d981f6a68c852fb29783ee664145bff840d1ad151315a91435acd8ed8a696297
MD5 15df5868fcf83e4d0c65e6abc1f4d406
BLAKE2b-256 e46234f7019752c6738c8ef0df0469c3d2a99c863d6b6f6357a9ed231ebd0fdd

See more details on using hashes here.

File details

Details for the file monobinpy-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: monobinpy-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 19.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.10

File hashes

Hashes for monobinpy-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f2c0e75a48bfe5c92c6bef7516c47c9bc39e3b53d50dbadbc0c0511dac618318
MD5 0de8352b84b38c85b47ff3394afcb9e3
BLAKE2b-256 c101f2536162e84a311aed4f2ddba658e7e2605e9f24ed0da9912a08fb9b7582

See more details on using hashes here.

Supported by

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