vp.features.delinquency
Days past due, worst in 12 months, ever cured after 60+ (catalog/delinquency.viv).
Part of the distribution vipyr; it runs from a checkout of the
repository. Planned on PyPI as pip install vipyr.
Signature
vp.features.delinquency(df=None, n=500) Parameters
- df : pandas.DataFrame, default
None - The event table, rows in any order; None makes a synthetic one of n rows.
- n : int, default
500 - Rows of the synthetic table when df is None. Range: >= 1.
Returns
A frozen DelinquencyResult. Iterating it gives the fields below in order; it also has
params, tests, log and check().
- frame : pandas.DataFrame
- The features, one row per input row, in the input's order and index: .
Raises
- TypeError
- An argument of the wrong type, or an unknown keyword.
- vipyr.VivBuildError
- An ImportError: no C compiler, or the program's C does not build.
Examples
import vipyr as vp
r = vp.features.delinquency() # a synthetic table; pass df= for yours
print(r.frame.head())
assert r.check() dpd worst_dpd_12m ever_cured_60
0 0 0 0
1 1 1 0
2 0 1 0
3 24 24 0
4 0 24 0Each example ran as written when these pages were generated, and the output shown is what it printed.
Checked against
- Reference
- catalog.delinquency_reference: a pandas groupby().apply() with a Python loop per row, equal bit for bit; vipyr.check_point_in_time: no feature reads a row after its own time
Source
- Viv: catalog/delinquency.viv
- Viv: catalog/catalog.py
- The defs it reaches and the calls between them: map of the code