Skip to main content

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) 

Metadata

Release files for monobinpy 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for monobinpy 0.0.1
File Size Uploaded
monobinpy-0.0.1.tar.gz 12.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for monobinpy 0.0.1
File Interpreter ABI Platform
monobinpy-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 32.4 kB

Release files / monobinpy-0.0.1.tar.gz

Download URL monobinpy-0.0.1.tar.gz
Size 12.6 kB
Tags Source
SHA-256 checksum
How to use checksums
d981f6a68c852fb29783ee664145bff840d1ad151315a91435acd8ed8a696297
BLAKE2b-256 checksum
How to use checksums
e46234f7019752c6738c8ef0df0469c3d2a99c863d6b6f6357a9ed231ebd0fdd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.10

Release files / monobinpy-0.0.1-py3-none-any.whl

Download URL monobinpy-0.0.1-py3-none-any.whl
Size 19.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f2c0e75a48bfe5c92c6bef7516c47c9bc39e3b53d50dbadbc0c0511dac618318
BLAKE2b-256 checksum
How to use checksums
c101f2536162e84a311aed4f2ddba658e7e2605e9f24ed0da9912a08fb9b7582
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.10

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page