From d94d65ed2dccbbdb2f5aa4511945a59ee7a2a36b Mon Sep 17 00:00:00 2001 From: Ankur Malik Date: Thu, 4 Dec 2025 10:50:08 -0500 Subject: [PATCH] Add pd v3 pre processing block --- README.md | 14 +- __init__.py | 1 + block.py | 734 +++++++++++++++++++++++++++++++++- data_dictionary_updated_A.csv | 61 +++ data_dictionary_updated_B.csv | 104 +++++ data_dictionary_updated_T.csv | 32 ++ request_schema.json | 568 +++++++++++++++++++++++++- requirements.txt | 2 +- response_schema.json | 12 +- test_block.py | 37 ++ 10 files changed, 1542 insertions(+), 23 deletions(-) create mode 100644 __init__.py create mode 100644 data_dictionary_updated_A.csv create mode 100644 data_dictionary_updated_B.csv create mode 100644 data_dictionary_updated_T.csv create mode 100644 test_block.py diff --git a/README.md b/README.md index 59a3efc..b240646 100644 --- a/README.md +++ b/README.md @@ -1 +1,13 @@ -**Hello world!!!** +# PD V3 Pre-Processing + +- **Inputs:** Raw Prod/Live feature values for all PD v3 models. +- **Outputs:** Three treated feature dictionaries (`model_a_features`, `model_b_features`, `model_t_features`). +- **Artifacts:** Driver CSVs stored under `drivers/`. +- **Tests:** `python -m unittest sequence-3.pd_v3_pre_processing.test_block`. +- **Signature:** `__main__` keeps an explicit typed parameter list covering every raw feature (int/float/str) and builds the record from those args before treatment; keep it aligned with `request_schema.json`. + +## Schema notes + +- `request_schema.json` now enumerates every raw Prod/Live variable as a top-level property (no `record` wrapper) so the contract mirrors `driver/request_schema_sample.json`. +- `response_schema.json` reflects the array-based payload returned by `block.__main__` (`model_*_features` are ordered lists of `{ "name": feature, "value": treated_value }` objects with feature name enums to enforce the allowlists). +- Both schemas are frozen and describe the flat/array-of-dict structures shown above; do not introduce dict-of-dicts or object-of-dicts in these files even if a future change reorients the Python implementation. diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..d3d26ed --- /dev/null +++ b/__init__.py @@ -0,0 +1 @@ +__all__ = ["__main__"] diff --git a/block.py b/block.py index 3b227f9..649699c 100644 --- a/block.py +++ b/block.py @@ -1,21 +1,717 @@ -@flowx_block -def example_function(request: dict) -> dict: +import csv +import math +from dataclasses import dataclass +from enum import Enum +from pathlib import Path +from typing import Any, Dict, Optional, Sequence, Set - # Processing logic here... - return { - "meta_info": [ - { - "name": "created_date", - "type": "string", - "value": "2024-11-05" - } - ], - "fields": [ - { - "name": "", - "type": "", - "value": "" - } - ] - } +class TreatmentType(str, Enum): + """Supported treatment rules from the driver dictionaries.""" + + UNK = "unk" + FIXED = "fixed" + + +@dataclass(frozen=True) +class VariableRule: + """Normalised representation of a single driver row.""" + + var_name: str + data_type: str + valid_min: Optional[float] + valid_max: Optional[float] + observed_cap_min_value: Optional[float] + observed_cap_max_value: Optional[float] + observed_default_treatment_value: Optional[str] + observed_missing_treatment_value: Optional[str] + default_treatment_type: Optional[TreatmentType] + is_predictor: bool + + +DRIVER_DIR = Path(__file__).parent +DRIVER_MAP: Dict[str, Dict[str, VariableRule]] = {} + +MODEL_FEATURE_ALLOWLIST = { + "model_a": ( + "AEPMAG05", + "RET201", + "PER201", + "PER202", + "PER222", + "PER225", + "PER235", + "CTM18", + "SC20S", + "AT36SD", + "FI36SD", + "G250BD", + "G250CD", + "US36SD", + "CV13", + "CV25", + "CV26", + "AT01S", + "AT104S", + "FI02S", + "FI20S", + "FI35S", + "G051S", + "G205S", + "G210S", + "G218A", + "G225S", + "G230S", + "G234S", + "G300S", + "IN02S", + "IN12S", + "OF20S", + "RT20S", + "INAP01", + "G106S", + "US02S", + "US20S", + "US24S", + "US28S", + "US32S", + "US35S", + "US36S", + "SE20S", + "US51A", + "G205B", + "INST_TRD", + "RTL_TRD", + "AGG402", + "AGG403", + "AGG423", + "AGG424", + "AGG903", + "TRV03", + "TRV04", + "BALMAG01", + "score_results", + ), + "model_b": ( + "UTLMAG01", + "AEPMAG04", + "PER201", + "PER203", + "PER222", + "PER223", + "PER224", + "PER225", + "PER235", + "CTM23", + "CT321", + "CTC20", + "CTA17", + "CTA18", + "SC21S", + "SCC92", + "SCBALM01", + "AT36SD", + "FI36SD", + "RE36SD", + "SE36SD", + "US36SD", + "LQA232YR", + "LQR325YR", + "RLE902", + "CV25", + "CV26", + "RVDEXQ2", + "AT01S", + "AT104S", + "AU20S", + "BI21S", + "BR33S", + "CO06S", + "FI02S", + "FI03S", + "FI20S", + "FI32S", + "FI33S", + "FI34S", + "FI35S", + "FI101S", + "FR21S", + "FR32S", + "G020S", + "G102S", + "G205S", + "G210S", + "G213A", + "G225S", + "G234S", + "G301S", + "G990S", + "IN02S", + "IN12S", + "MT21S", + "OF09S", + "OF21S", + "OF29S", + "OF35S", + "RE32S", + "RT36S", + "ST01S", + "INAP01", + "G106S", + "S204S", + "US02S", + "US03S", + "US12S", + "US20S", + "US24S", + "US30S", + "US34S", + "SE20S", + "SE21S", + "SE34S", + "SE36S", + "JT20S", + "JT33S", + "JT70S", + "G404S", + "G405S", + "G406S", + "G407S", + "G416S", + "G417S", + "US51A", + "INST_TRD", + "NOMT_TRD", + "AGG512", + "AGG516", + "AGG902", + "AGG903", + "TRV03", + "TRV04", + "TRV06", + "BALMAG01", + "RVLR14", + "PAYMNT06", + "PAYMNT07", + "score_results", + ), + "model_t": ( + "PDMAG01", + "AEPMAG05", + "AUT201", + "PER201", + "PER203", + "PER204", + "PER205", + "PER223", + "PER225", + "PER253", + "CTA17", + "SE21CD", + "RLE907", + "CV26", + "AT35B", + "FI28S", + "FI32S", + "INAP01", + "US01S", + "US28S", + "US34S", + "US101S", + "SE02S", + "SE06S", + "SE09S", + "SE20S", + "TRV06", + "TRV10", + "PAYMNT06", + ), +} + +MODEL_OUTPUT_FEATURE_ALLOWLIST = { + "model_a_features": MODEL_FEATURE_ALLOWLIST["model_a"] + ("PER201_unk", "G225S_unk", "SC20S_unk", "RET201_unk", "US24S_unk"), + "model_b_features": MODEL_FEATURE_ALLOWLIST["model_b"], + "model_t_features": MODEL_FEATURE_ALLOWLIST["model_t"] + ("AEPMAG05_unk", "PER201_unk"), +} + + +def _to_float(candidate: Optional[str]) -> Optional[float]: + if candidate in (None, "", "null", "None"): + return None + try: + return float(candidate) + except (TypeError, ValueError): + return None + + +def _to_bool(candidate: Optional[str]) -> bool: + return str(candidate).strip() in {"1", "1.0", "true", "True"} + + +def _normalise_data_type(data_type: str) -> str: + if not data_type: + return "string" + data_type = data_type.strip().lower() + if data_type in {"float", "double"}: + return "float" + if data_type in {"int", "integer"}: + return "int" + return "string" + + +def _load_driver(name: str, allowed_features: Optional[Set[str]] = None) -> Dict[str, VariableRule]: + path = DRIVER_DIR / name + with path.open(newline="", encoding="utf-8") as csv_file: + reader = csv.DictReader(csv_file) + metadata: Dict[str, VariableRule] = {} + for row in reader: + if not _to_bool(row.get("is_predictor")): + continue + var_name = row["var_name"] + if allowed_features is not None and var_name not in allowed_features: + continue + + treatment_type_raw = (row.get("default_treatment_type") or "").strip().lower() + treatment_type: Optional[TreatmentType] + if treatment_type_raw: + treatment_type = TreatmentType(treatment_type_raw) + else: + treatment_type = None + + rule = VariableRule( + var_name=var_name, + data_type=_normalise_data_type(row.get("data_type", "")), + valid_min=_to_float(row.get("valid_min")), + valid_max=_to_float(row.get("valid_max")), + observed_cap_min_value=_to_float(row.get("observed_cap_min_value")), + observed_cap_max_value=_to_float(row.get("observed_cap_max_value")), + observed_default_treatment_value=row.get("observed_default_treatment_value") or None, + observed_missing_treatment_value=row.get("observed_missing_treatment_value") or None, + default_treatment_type=treatment_type, + is_predictor=True, + ) + metadata[rule.var_name] = rule + return metadata + + +def _ensure_driver_map() -> None: + if DRIVER_MAP: + return + DRIVER_MAP["model_a"] = _load_driver("data_dictionary_updated_A.csv", set(MODEL_FEATURE_ALLOWLIST["model_a"])) + DRIVER_MAP["model_b"] = _load_driver("data_dictionary_updated_B.csv", set(MODEL_FEATURE_ALLOWLIST["model_b"])) + DRIVER_MAP["model_t"] = _load_driver("data_dictionary_updated_T.csv", set(MODEL_FEATURE_ALLOWLIST["model_t"])) + + +def _is_number(value: Any) -> bool: + return isinstance(value, (int, float)) and not isinstance(value, bool) + + +def _is_missing(value: Any) -> bool: + if value is None: + return True + if isinstance(value, float) and math.isnan(value): + return True + if isinstance(value, str) and not value.strip(): + return True + return False + + +def _safe_cast(value: Any, data_type: str) -> Any: + if value in (None, "", "null", "NULL"): + return None + try: + if data_type == "int": + if isinstance(value, str): + value = value.strip() + return int(float(value)) + if data_type == "float": + return float(value) + return str(value) + except (TypeError, ValueError): + return None + + +def _value_out_of_range(value: Any, minimum: Optional[float], maximum: Optional[float]) -> bool: + if not _is_number(value): + return False + if minimum is not None and value < minimum: + return True + if maximum is not None and value > maximum: + return True + return False + + +def _process_rule( + raw_record: Dict[str, Any], + processed_record: Dict[str, Any], + rule: VariableRule, + lookup: Dict[str, VariableRule], +) -> None: + if rule.var_name.endswith("_unk"): + # Engineered flag is handled when the base variable is processed. + return + + value = _safe_cast(raw_record.get(rule.var_name), rule.data_type) + out_of_range = _value_out_of_range(value, rule.valid_min, rule.valid_max) + null_due_to_unk_outlier = False + is_missing_value = _is_missing(value) + + if rule.default_treatment_type == TreatmentType.UNK: + unk_name = f"{rule.var_name}_unk" + if unk_name not in processed_record: + processed_record[unk_name] = 0 + if out_of_range or is_missing_value: + processed_record[unk_name] = 1 + value = None + null_due_to_unk_outlier = True + else: + processed_record[unk_name] = 0 + elif rule.default_treatment_type == TreatmentType.FIXED and out_of_range: + value = None + + if _is_number(value): + if rule.observed_cap_min_value is not None and value < rule.observed_cap_min_value: + value = rule.observed_cap_min_value + if rule.observed_cap_max_value is not None and value > rule.observed_cap_max_value: + value = rule.observed_cap_max_value + + if not null_due_to_unk_outlier and _value_out_of_range(value, rule.valid_min, rule.valid_max): + default_value = rule.observed_default_treatment_value + if default_value is not None: + value = _safe_cast(default_value, rule.data_type) + + if not null_due_to_unk_outlier and _is_missing(value): + missing_value = rule.observed_missing_treatment_value + if missing_value is not None: + value = _safe_cast(missing_value, rule.data_type) + + processed_record[rule.var_name] = value + + +def _process_model( + record: Dict[str, Any], + lookup: Dict[str, VariableRule], + allowed_features: Optional[Sequence[str]] = None, +) -> Dict[str, Any]: + processed: Dict[str, Any] = {} + for rule in lookup.values(): + _process_rule(record, processed, rule, lookup) + + # Ensure engineered _unk fields default to 0 when not explicitly set. + for var_name, rule in lookup.items(): + if var_name.endswith("_unk") and var_name not in processed and rule.is_predictor: + processed[var_name] = 0 + + if allowed_features is not None: + processed = {key: processed.get(key) for key in allowed_features} + + return processed + +def __main__( + AEPMAG04: int, + AEPMAG05: int, + AGG402: int, + AGG403: int, + AGG423: int, + AGG424: int, + AGG512: int, + AGG516: int, + AGG902: int, + AGG903: int, + AT01S: int, + AT104S: int, + AT35B: int, + AT36SD: int, + AU20S: int, + AUT201: float, + BALMAG01: int, + BI21S: int, + BR33S: int, + CO06S: int, + CT321: int, + CTA17: int, + CTA18: int, + CTC20: int, + CTM18: int, + CTM23: int, + CV13: float, + CV25: float, + CV26: float, + FI02S: int, + FI03S: int, + FI101S: int, + FI20S: int, + FI28S: int, + FI32S: int, + FI33S: int, + FI34S: int, + FI35S: int, + FI36SD: int, + FR21S: int, + FR32S: int, + G020S: int, + G051S: int, + G102S: int, + G106S: int, + G205B: int, + G205S: int, + G210S: int, + G213A: int, + G218A: int, + G225S: int, + G230S: int, + G234S: int, + G250BD: int, + G250CD: int, + G300S: int, + G301S: int, + G404S: int, + G405S: int, + G406S: int, + G407S: int, + G416S: int, + G417S: int, + G990S: int, + IN02S: int, + IN12S: int, + INAP01: int, + INST_TRD: int, + JT20S: int, + JT33S: int, + JT70S: int, + LQA232YR: float, + LQR325YR: float, + MT21S: int, + NOMT_TRD: int, + OF09S: int, + OF20S: int, + OF21S: int, + OF29S: int, + OF35S: int, + PAYMNT06: float, + PAYMNT07: float, + PDMAG01: int, + PER201: float, + PER202: float, + PER203: float, + PER204: float, + PER205: float, + PER222: float, + PER223: float, + PER224: float, + PER225: float, + PER235: int, + PER253: int, + RE32S: int, + RE36SD: int, + RET201: float, + RLE902: int, + RLE907: int, + RT20S: int, + RT36S: int, + RTL_TRD: int, + RVDEXQ2: int, + RVLR14: str, + S204S: int, + SC20S: int, + SC21S: int, + SCBALM01: int, + SCC92: int, + score_results: int, + SE02S: int, + SE06S: int, + SE09S: int, + SE20S: int, + SE21CD: int, + SE21S: int, + SE34S: int, + SE36S: int, + SE36SD: int, + ST01S: int, + TRV03: int, + TRV04: int, + TRV06: int, + TRV10: int, + US01S: int, + US02S: int, + US03S: int, + US101S: int, + US12S: int, + US20S: int, + US24S: int, + US28S: int, + US30S: float, + US32S: int, + US34S: int, + US35S: int, + US36S: int, + US36SD: int, + US51A: int, + UTLMAG01: int, + + +) -> dict: + + record = { + "AEPMAG04": AEPMAG04, + "AEPMAG05": AEPMAG05, + "AGG402": AGG402, + "AGG403": AGG403, + "AGG423": AGG423, + "AGG424": AGG424, + "AGG512": AGG512, + "AGG516": AGG516, + "AGG902": AGG902, + "AGG903": AGG903, + "AT01S": AT01S, + "AT104S": AT104S, + "AT35B": AT35B, + "AT36SD": AT36SD, + "AU20S": AU20S, + "AUT201": AUT201, + "BALMAG01": BALMAG01, + "BI21S": BI21S, + "BR33S": BR33S, + "CO06S": CO06S, + "CT321": CT321, + "CTA17": CTA17, + "CTA18": CTA18, + "CTC20": CTC20, + "CTM18": CTM18, + "CTM23": CTM23, + "CV13": CV13, + "CV25": CV25, + "CV26": CV26, + "FI02S": FI02S, + "FI03S": FI03S, + "FI101S": FI101S, + "FI20S": FI20S, + "FI28S": FI28S, + "FI32S": FI32S, + "FI33S": FI33S, + "FI34S": FI34S, + "FI35S": FI35S, + "FI36SD": FI36SD, + "FR21S": FR21S, + "FR32S": FR32S, + "G020S": G020S, + "G051S": G051S, + "G102S": G102S, + "G106S": G106S, + "G205B": G205B, + "G205S": G205S, + "G210S": G210S, + "G213A": G213A, + "G218A": G218A, + "G225S": G225S, + "G230S": G230S, + "G234S": G234S, + "G250BD": G250BD, + "G250CD": G250CD, + "G300S": G300S, + "G301S": G301S, + "G404S": G404S, + "G405S": G405S, + "G406S": G406S, + "G407S": G407S, + "G416S": G416S, + "G417S": G417S, + "G990S": G990S, + "IN02S": IN02S, + "IN12S": IN12S, + "INAP01": INAP01, + "INST_TRD": INST_TRD, + "JT20S": JT20S, + "JT33S": JT33S, + "JT70S": JT70S, + "LQA232YR": LQA232YR, + "LQR325YR": LQR325YR, + "MT21S": MT21S, + "NOMT_TRD": NOMT_TRD, + "OF09S": OF09S, + "OF20S": OF20S, + "OF21S": OF21S, + "OF29S": OF29S, + "OF35S": OF35S, + "PAYMNT06": PAYMNT06, + "PAYMNT07": PAYMNT07, + "PDMAG01": PDMAG01, + "PER201": PER201, + "PER202": PER202, + "PER203": PER203, + "PER204": PER204, + "PER205": PER205, + "PER222": PER222, + "PER223": PER223, + "PER224": PER224, + "PER225": PER225, + "PER235": PER235, + "PER253": PER253, + "RE32S": RE32S, + "RE36SD": RE36SD, + "RET201": RET201, + "RLE902": RLE902, + "RLE907": RLE907, + "RT20S": RT20S, + "RT36S": RT36S, + "RTL_TRD": RTL_TRD, + "RVDEXQ2": RVDEXQ2, + "RVLR14": RVLR14, + "S204S": S204S, + "SC20S": SC20S, + "SC21S": SC21S, + "SCBALM01": SCBALM01, + "SCC92": SCC92, + "score_results": score_results, + "SE02S": SE02S, + "SE06S": SE06S, + "SE09S": SE09S, + "SE20S": SE20S, + "SE21CD": SE21CD, + "SE21S": SE21S, + "SE34S": SE34S, + "SE36S": SE36S, + "SE36SD": SE36SD, + "ST01S": ST01S, + "TRV03": TRV03, + "TRV04": TRV04, + "TRV06": TRV06, + "TRV10": TRV10, + "US01S": US01S, + "US02S": US02S, + "US03S": US03S, + "US101S": US101S, + "US12S": US12S, + "US20S": US20S, + "US24S": US24S, + "US28S": US28S, + "US30S": US30S, + "US32S": US32S, + "US34S": US34S, + "US35S": US35S, + "US36S": US36S, + "US36SD": US36SD, + "US51A": US51A, + "UTLMAG01": UTLMAG01 + } + + + _ensure_driver_map() + + return {"results": [ + {"model_a_features": _process_model( + record, + DRIVER_MAP["model_a"], + MODEL_OUTPUT_FEATURE_ALLOWLIST["model_a_features"], + ), + "model_b_features": _process_model( + record, + DRIVER_MAP["model_b"], + MODEL_OUTPUT_FEATURE_ALLOWLIST["model_b_features"], + ), + "model_t_features": _process_model( + record, + DRIVER_MAP["model_t"], + MODEL_OUTPUT_FEATURE_ALLOWLIST["model_t_features"] + )}] + } diff --git a/data_dictionary_updated_A.csv b/data_dictionary_updated_A.csv new file mode 100644 index 0000000..b1fce37 --- /dev/null +++ b/data_dictionary_updated_A.csv @@ -0,0 +1,61 @@ +var_name,description,data_type,valid_min,valid_max,cap_min_type,cap_min_value,cap_max_type,cap_max_value,default_treatment_type,default_treatment_value,missing_treatment_type,missing_treatment_value,scaling_type,encoding_type,is_category,is_predictor,is_id,is_target,monotonic,force,ignore,observed_cap_min_value,observed_cap_max_value,observed_default_treatment_value,observed_missing_treatment_value +AEPMAG05,The aggregate excess payment magnitude algorithm measures the degree of aggregate personal loan aggregate excess payment change over the last 24 months by considering the aggregate excess payment patterns. High indexes indicate a high degree of aggregate excess payment growth.,int,0,600,fixed,23,percentile,0.99,unk,,,,,,,1,,,-1,0,0,23,374,, +RET201,Total payment ratio (payment made/minimum payment due) for retail accounts over the past 1 month,float,0,50,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,13,, +PER201,Total payment ratio for personal loans over the past month,float,0,50,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,7,, +PER202,Total payment ratio for personal loans over the past 3 months,float,0,50,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,6,, +PER222,Average payment ratio for personal loans over the past 3 months,float,0,50,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,6,, +PER225,Average payment ratio for personal loans over the past 24 months,float,0,50,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,5,, +PER235,Aggregate excess payment for personal loans over the past 24 months,int,0,999999999,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,19137,, +CTM18,Number of balance increases for non-mortgage accounts in the last 3 months. Increases are measured on a month-over-month basis for each account over the most recent 3 months for consumers who have moved. Note: Move date is the latest update to the primary address of the consumer,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,26,, +SC20S,Months since oldest secured card opened,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,133,, +AT36SD,Months since most recent delinquency,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,999,, +FI36SD,Months since most recent finance installment delinquency,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,999,, +G250BD,Number of 30 days past due or worse items in the past 12 months (excluding medical collection items),int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,12,, +G250CD,Number of 30 days past due or worse items in the past 24 months (excluding medical collection items),int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,15,, +US36SD,Months since most recent unsecured installment delinquency,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,999,, +CV13,The percentage of total accounts that have ever been 30 or more days past due,float,0,100,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,71,, +CV25,The percentage of accounts that went from inactive ($0 balance) to active (balance > $0) at any time within the past 12 months.,float,0,100,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,25,, +CV26,The percentage of accounts that went from active (balance > $0) to inactive ($0 balance) at any time within the past 12 months.,float,0,100,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,60,, +AT01S,Number of trades,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,139,, +AT104S,Ratio of all trades opened in past 24 months to all trades,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,100,, +BC33S,Total balance of open credit cards verified in past 12 months,int,0,999999999,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,26226,, +FI20S,Months since oldest finance installment loan opened,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,219,, +FI35S,Average balance of open finance installment loans verified in past 12 months,int,0,999999999,fixed,1,percentile,0.99,unk,,,,,,,1,,,-1,0,0,1,34335,, +G051S,Percentage of trades ever delinquent,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,71,, +G205S,Total monthly obligation (minimum payment due) for individual accounts verified in past 12 months. Note: Excludes joint accounts. Note: Sum of payment due amounts (no calculations/inferences),int,0,999999999,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,3470,, +G210S,Total past due amount of charged-off trades verified in past 12 months,int,0,999999999,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,33163,, +G218A,Number of trades verified in the past 12 months that are currently 30 days past due,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,2,, +G225S,Total past due amount of currently 90 or more days past due trades,int,0,999999999,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,35362,, +G234S,Number of days with inquiry occurring in past 30 days,int,0,31,fixed,0,fixed,31,unk,,,,,,,1,,,1,0,0,0,31,, +G300S,"Worst rating on credit cards in past 12 months: 0 No rating available,1 Paid or paying as agreed, 2 30 days past due, 3 60 days past due, 4 90 days past due, 5 120 days pastdue, 8 Repossession/Surrender, 9 Charged Off as Bad Debt/Collection, 10 Bankruptc",int,-4,10,,0,,,,,,,,,1,1,,,-1,0,0,-4,10,, +G980S,Number of deduped inquiries in past 6 months,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,9,, +IN02S,Number of open installment loans,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,17,, +IN12S,Number of open installment loans verified in past 12 months,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,17,, +OF20S,Months since oldest credit union trade opened,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,274,, +RT20S,Months since oldest retail trade opened,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,338,, +INAP01,"Total scheduled monthly payment for open installment loans verified in past 12 months. Note: If monthly payment amount is missing, it will be imputed",int,0,999999999,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,3014,, +G106S,Months on file,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,551,, +US02S,Number of open unsecured installment loans,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,7,, +US20S,Months since oldest unsecured installment loan opened,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,185,, +US24S,Number of currently open and satisfactory unsecured installment loans 6 months or older. Note: Satisfactory means MOP = 01,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,5,, +US28S,Total loan amount of open unsecured installment loans verified in past 12 months,int,0,999999999,fixed,20,percentile,0.99,unk,,,,,,,1,,,-1,0,0,20,39520,, +US32S,Maximum current balance owed on open unsecured installment loans verified in past 12 months,int,0,999999999,fixed,1,percentile,0.99,unk,,,,,,,1,,,-1,0,0,1,23711,, +US35S,Average balance of open unsecured installment loans verified in past 12 months,int,0,999999999,fixed,1,percentile,0.99,unk,,,,,,,1,,,-1,0,0,1,12770,, +US36S,Months since most recent unsecured installment loan delinquency. Note: Delinquency is defined as 30 days past due or worse,int,0,84,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,76,, +SE20S,Months since oldest secured installment loan opened,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,222,, +US51A,Terms in months of most recent unsecured installment trade,int,0,999,fixed,1,percentile,0.99,unk,,,,,,,1,,,-1,0,0,1,57,, +G205B,Total monthly obligation for individual account verified in past 12 months and with a current balance > 0,int,0,999999999,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,3486,, +INST_TRD,Number of installment loans,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,132,, +RTL_TRD,Number of retail tradelines,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,20,, +AGG402,Total non-mortgage actual payment amount for month 2. AGG401 is the aggregate non-mortgage actual,int,0,999999999,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,6795,, +AGG403,Total non-mortgage actual payment amount for month 3. AGG401 is the aggregate non-mortgage actual,int,0,999999999,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,7551,, +AGG423,Total non-mortgage actual payment amount for month 23. AGG401 is the aggregate non-mortgage actual,int,0,999999999,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,8935,, +AGG424,Total non-mortgage actual payment amount for month 24. AGG401 is the aggregate non-mortgage actual,int,0,999999999,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,8931,, +AGG903,This algorithm counts the number of monthly aggregate non-mortgage credit limit increases over the last 3 months.,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,3,, +TRV03,The number of non-mortgage account balance increases from last month to the current month.,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,10,, +TRV04,The number of balance increases for non-mortgage accounts over the last 3 months. Increases are measured on a month-over-month basis for each,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,26,, +BALMAG01,The balance magnitude algorithm measures the degree of aggregate non-mortgage balance change over the last 24 months by considering the balance,int,0,600,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,466,, +score_results,TruVision Trended New Account Score 2.0:Risk score focused on new account performance (Bad = 90+ dpd in 24 months),int,300,850,fixed,423,fixed,850,unk,,,,,,0,1,,,-1,0,0,423,850,, +tuseqno_accid,Unique Applicant ID ,int,,,,,,,,,,,,,,0,1,,,0,0,0,0,, +G230S,Number of 60 or more days past due trades (current MOP only) with balance > $0 opened in past 24 months,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,6,, +FI02S,Number of open finance installment loans,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,9,, diff --git a/data_dictionary_updated_B.csv b/data_dictionary_updated_B.csv new file mode 100644 index 0000000..c25aeaf --- /dev/null +++ b/data_dictionary_updated_B.csv @@ -0,0 +1,104 @@ +var_name,description,data_type,valid_min,valid_max,cap_min_type,cap_min_value,cap_max_type,cap_max_value,default_treatment_type,default_treatment_value,missing_treatment_type,missing_treatment_value,scaling_type,encoding_type,is_category,is_predictor,is_id,is_target,monotonic,force,ignore,observed_cap_min_value,observed_cap_max_value,observed_default_treatment_value,observed_missing_treatment_value +PER235,Aggregate excess payment for personal loans over the past 24 months,int,0,999999999,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,17844,, +PER201,Total payment ratio for personal loans over the past month,float,0,50,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,7,, +PER203,Total payment ratio for personal loans over the past 6 months,float,0,50,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,7,, +PER222,Average payment ratio for personal loans over the past 3 months,float,0,50,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,7,, +PER223,Average payment ratio for personal loans over the past 6 months,float,0,50,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,7,, +PER224,Average payment ratio for personal loans over the past 12 months,float,0,50,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,7,, +PER225,Average payment ratio for personal loans over the past 24 months,float,0,50,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,6,, +RLE902,Number of over-payments on real estate accounts in the past 12 months,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,12,, +INST_TRD,Number of installment loans,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,130,, +NOMT_TRD,Number of non-mortgage tradelines,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,136,, +AGG512,Total bankcard balance for month 12. AGG501 is the aggregate bankcard balance reported,int,0,999999999,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,22638,, +AGG516,Total bankcard balance for month 16. AGG501 is the aggregate bankcard balance reported,int,0,999999999,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,22033,, +AGG902,This algorithm counts the number of monthly aggregate non-mortgage balance decreases over the last 3 months.,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,3,, +AGG903,This algorithm counts the number of monthly aggregate non-mortgage credit limit increases over the last 3 months.,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,3,, +TRV03,The number of non-mortgage account balance increases from last month to the current month.,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,9,, +TRV04,The number of balance increases for non-mortgage accounts over the last 3 months. Increases are measured on a month-over-month basis for each,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,25,, +TRV06,The number of months with at least one nonmortgage account balance increase over the last 12 months. If multiple accounts have a balance increase,int,0,12,fixed,0,fixed,12,unk,,,,,,,1,,,-1,0,0,0,12,, +BALMAG01,The balance magnitude algorithm measures the degree of aggregate non-mortgage balance change over the last 24 months by considering the balance,int,0,600,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,484,, +RVLR14,Revolver/Transactor/Inactive pattern for months 1 through 8 for Bankcard 1.(Note: Bankcard 1 is defined as the bankcard with the highest balance in the current month.),string,,,,,,,,,,,,,1,1,,,,0,0,,,, +PAYMNT06,The ratio of the sum of all payments to the sum of all the minimum monthly obligations reported in the last 6 months for installment accounts.,float,0,50,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,7,, +PAYMNT07,The ratio of the total payments to total minimum obligations for non-mortgage accounts this month,float,0,50,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,11,, +AEPMAG04,The aggregate excess payment magnitude algorithm measures the degree of aggregate retail aggregate excess payment change over the last 24 months by considering the aggregate excess payment patterns. High indexes indicate a high degree of aggregate excess payment growth.,int,0,600,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,383,, +UTLMAG01,The utilization magnitude algorithm measures the degree of aggregate non-mortgage utilization change over the last 24 months by considering the utilization patterns. High indexes indicate a high degree of utilization growth.,int,0,600,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,450,, +CT321,Number of payments made on each account since the last 30 days past due rating,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,162,, +CTA17,Number of instances where a non-mortgage account was utilized more than 90% since the most recent account was opened,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,61,, +CTA18,Number of balance increases for non-mortgage accounts in the last 3 months. Increases are measured on a month-over-month basis for each account over the most recent 3 months since most recent account was opened,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,20,, +CTC20,"Number of payments made on each account over the most recent 3 months since the last derogatory. Note: Derogatory is defined as non-medical collection, charge-off, repossession, foreclosure, or bankruptcy",int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,43,, +CTM23,Number of months since move date Note: Move date is the latest update to the primary address of the consumer,int,0,999,fixed,1,percentile,0.99,unk,,,,,,,1,,,-1,0,0,1,24,, +CV25,The percentage of accounts that went from inactive ($0 balance) to active (balance > $0) at any time within the past 12 months.,float,0,100,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,27,, +CV26,The percentage of accounts that went from active (balance > $0) to inactive ($0 balance) at any time within the past 12 months.,float,0,100,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,60,, +LQA232YR,Percent change in aggregate excess payment from months 13-15 to months 1-3,float,-5000,5000,fixed,-6006,percentile,0.99,unk,,,,,,,1,,,-1,0,0,-6006,100,, +LQR325YR,Percent change in average aggregate open-to-buy for revolving accounts from months 13-15 to months 1-3,float,-5000,5000,fixed,-6006,percentile,0.99,unk,,,,,,,1,,,-1,0,0,-6006,100,, +SC21S,Months since most recent secured card opened,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,128,, +SCBALM01,Secured Card balance magnitude ( balance change over last 24 months),int,0,999999999,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,453,, +SCC92,Number of months in the past 12 months where percentage of secured cards utilized less than 25% was more than 25%,int,0,12,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,12,, +AT01S,Number of trades,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,136,, +AT104S,Ratio of all trades opened in past 24 months to all trades,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,100,, +AU20S,Months since oldest auto trade opened,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,187,, +BI21S,Months since most recent bank installment trade opened,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,204,, +BR33S,Total balance of open bank revolving trades verified in past 12 months,int,0,999999999,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,20558,, +CO06S,Total balance of trades that charged off in the past 12 months,int,0,999999999,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,28695,, +FI02S,Number of open finance installment loans,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,9,, +FI03S,Number of currently satisfactory open finance installment loans. Note: Satisfactory means MOP = 01,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,9,, +FI101S,Total balance of all finance installment loans verified in past 12 months. Note: Includes both open and closed finance installment loans,int,0,999999999,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,79489,, +FI20S,Months since oldest finance installment loan opened,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,205,, +FI32S,Maximum current balance owed on open finance installment loans verified in past 12 months,int,0,999999999,fixed,-4,percentile,0.99,unk,,,,,,,1,,,1,0,0,-4,51515,, +FI33S,Total balance of open finance installment loans verified in past 12 months,int,0,999999999,fixed,-4,percentile,0.99,unk,,,,,,,1,,,1,0,0,-4,78446,, +FI34S,Utilization for open finance installment loans verified in past 12 months,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,133,, +FI35S,Average balance of open finance installment loans verified in past 12 months,int,0,999999999,fixed,1,percentile,0.99,unk,,,,,,,1,,,-1,0,0,1,31130,, +FR21S,Months since most recent finance revolving trade opened,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,148,, +FR32S,Maximum current balance owed on open finance revolving trades verified in past 12 months,int,0,999999999,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,7515,, +G020S,Number of trades with maximum delinquency of 30 days past due occurring in past 24 months,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,48,, +G102S,Months since most recent inquiry,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,21,, +G106S,Months on file,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,558,, +G205S,Total monthly obligation (minimum payment due) for individual accounts verified in past 12 months. Note: Excludes joint accounts. Note: Sum of payment due amounts (no calculations/inferences),int,0,999999999,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,3130,, +G210S,Total past due amount of charged-off trades verified in past 12 months,int,0,999999999,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,31182,, +G213A,Highest balance of third party collections verified in 24 months,int,0,999999999,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,13773,, +G225S,Total past due amount of currently 90 or more days past due trades,int,0,999999999,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,33817,, +G234S,Number of days with inquiry occurring in past 30 days,int,0,31,fixed,0,fixed,31,unk,,,,,,,1,,,1,0,0,0,31,, +G301S,"Worst rating on credit cards: 0 No rating available, 1 Paid or paying as agreed, 2 30 days past due, 3 60 days past due, 4 90 days past due, 5 120 days past due, 8 repossession/Surrender, 9 Charged Off as Bad Debt/Collection, 10 Bankruptcy",int,0,10,,0,,,,,,,,,1,1,,,-1,0,0,,,, +G404S,Number of deduped finance inquiries in past 3 months,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,4,, +G405S,Number of deduped finance inquiries in past 6 months,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,6,, +G406S,Number of deduped finance inquiries in past 12 months,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,9,, +G407S,Number of deduped finance inquiries,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,13,, +G416S,Months since most recent finance inquiry,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,22,, +G417S,Months since most recent bank inquiry,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,23,, +G990S,Number of deduped inquiries in past 12 months,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,16,, +IN02S,Number of open installment loans,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,17,, +IN12S,Number of open installment loans verified in past 12 months,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,18,, +INAP01,"Total scheduled monthly payment for open installment loans verified in past 12 months. Note: If monthly payment amount is missing, it will be imputed",int,0,999999999,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,2750,, +JT20S,Months since oldest joint trade opened,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,333,, +JT33S,Total balance of joint trades in the last 12 months,int,0,999999999,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,321914,, +JT70S,Ratio of dollars past due joint trades to total dollars past due trades,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,100,, +MT21S,Months since most recent mortgage trade opened,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,384,, +OF09S,Number of credit union trades opened in past 24 months,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,7,, +OF21S,Months since most recent credit union trade opened,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,175,, +OF29S,Number of open credit union trades with balance > $0 verified in past 12 months,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,5,, +OF35S,Average balance of open credit union trades verified in past 12 months,int,0,999999999,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,56114,, +RE32S,Maximum current balance owed on open revolving trades verified in past 12 months,int,0,999999999,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,11874,, +RT36S,Months since most recent retail delinquency. Note: Delinquency is defined as 30 days past due or worse,int,0,84,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,74,, +S204S,Total balance of third party collections verified in past 12 months,int,0,999999999,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,20624,, +SE20S,Months since oldest secured installment loan opened,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,193,, +SE21S,Months since most recent secured installment loan opened,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,120,, +SE34S,Utilization for open secured installment loans verified in past 12 months,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,116,, +SE36S,Months since most recent secured installment loan delinquency. Note: Delinquency is defined as 30 days past due or worse,int,0,84,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,77,, +ST01S,Number of student loan trades Note: Includes deferred,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,19,, +US02S,Number of open unsecured installment loans,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,8,, +US03S,Number of currently satisfactory open unsecured installment loans. Note: Satisfactory means MOP = 01,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,8,, +US12S,Number of open unsecured installment loans verified in past 12 months,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,8,, +US20S,Months since oldest unsecured installment loan opened,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,181,, +US24S,Number of currently open and satisfactory unsecured installment loans 6 months or older. Note: Satisfactory means MOP = 01,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,5,, +US30S,"Percentage of open unsecured installment loans that are greater than 50% utilized, verified in past 12 months",float,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,100,, +US34S,Utilization for open unsecured installment loans verified in past 12 months,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,137,, +US51A,Terms in months of most recent unsecured installment trade,int,0,999,fixed,1,percentile,0.99,unk,,,,,,,1,,,-1,0,0,1,59,, +AT36SD,Months since most recent delinquency,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,999,, +FI36SD,Months since most recent finance installment delinquency,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,999,, +RE36SD,Months since most recent revolving delinquency,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,999,, +SE36SD,Months since most recent secured installment delinquency,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,999,, +US36SD,Months since most recent unsecured installment delinquency,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,999,, +RVDEXQ2,Aggregate Q2(Quarter 2) revolving spend relative to annual revolving spend,int,0,100,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,100,, +score_results,TruVision Trended New Account Score 2.0:Risk score focused on new account performance (Bad = 90+ dpd in 24 months),int,300,850,fixed,423,fixed,850,unk,,,,,,0,1,,,-1,0,0,423,850,, +tuseqno_accid,Unique Applicant ID ,int,,,,,,,,,,,,,,0,1,,,0,0,,,, +DPD60_MOB9,DPD60 MOB 9 months flag ,int,0,1,,0,,,,,,,,,,0,,1,,0,0,,,, diff --git a/data_dictionary_updated_T.csv b/data_dictionary_updated_T.csv new file mode 100644 index 0000000..99caa5e --- /dev/null +++ b/data_dictionary_updated_T.csv @@ -0,0 +1,32 @@ +var_name,description,data_type,valid_min,valid_max,cap_min_type,cap_min_value,cap_max_type,cap_max_value,default_treatment_type,default_treatment_value,missing_treatment_type,missing_treatment_value,scaling_type,encoding_type,is_category,is_predictor,is_id,is_target,monotonic,force,ignore,observed_cap_min_value,observed_cap_max_value,observed_default_treatment_value,observed_missing_treatment_value +US34S,Utilization for open unsecured installment loans verified in past 12 months,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,142,, +US28S,Total loan amount of open unsecured installment loans verified in past 12 months,int,0,999999999,fixed,20,percentile,0.99,unk,,,,,,,1,,,-1,0,0,20,34594,, +US101S,Total balance of all unsecured installment loans verified in past 12 months,int,0,999999999,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,29848,, +US01S,Number of unsecured installment loans,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,103,, +TRV10,The number of months with at least one nonmortgage account balance decrease over the last 12 months. If multiple accounts have a balance,int,0,12,fixed,0,fixed,12,unk,,,,,,,1,,,1,0,0,0,12,, +TRV06,The number of months with at least one nonmortgage account balance increase over the last 12 months. If multiple accounts have a balance increase,int,0,12,fixed,0,fixed,12,unk,,,,,,,1,,,-1,0,0,0,12,, +SE21CD,Months since most recent unpaid secured installment 120+ dpd or worse trade reported as closed,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,999,, +SE20S,Months since oldest secured installment loan opened,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,204,, +SE09S,Number of secured installment loans opened in past 24 months,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,9,, +SE06S,Number of secured installment loans opened in past 6 months,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,3,, +SE02S,Number of open secured installment loans,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,3,, +RLE907,Months since most recent over-payment on a real estate account,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,999,, +PER253,Average aggregate excess payment for personal loans over the past 6 months,int,0,999999999,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,1276,, +PER225,Average payment ratio for personal loans over the past 24 months,float,0,50,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,6,, +PER223,Average payment ratio for personal loans over the past 6 months,float,0,50,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,7,, +PER205,Total payment ratio for personal loans over the past 24 months,float,0,50,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,6,, +PER204,Total payment ratio for personal loans over the past 12 months,float,0,50,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,6,, +PER203,Total payment ratio for personal loans over the past 6 months,float,0,50,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,7,, +PER201,Total payment ratio for personal loans over the past month,float,0,50,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,7,, +PDMAG01,The past due magnitude algorithm measures the degree of aggregate non-mortgage past due amount change over the last 24 months by considering the past due amount patterns. High indexes indicate a high degree of past due amount growth.,int,0,600,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,600,, +PAYMNT06,The ratio of the sum of all payments to the sum of all the minimum monthly obligations reported in the last 6 months for installment accounts.,float,0,50,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,7,, +INAP01,"Total scheduled monthly payment for open installment loans verified in past 12 months. Note: If monthly payment amount is missing, it will be imputed",int,0,999999999,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,2849,, +FI32S,Maximum current balance owed on open finance installment loans verified in past 12 months,int,0,999999999,fixed,-4,percentile,0.99,unk,,,,,,,1,,,1,0,0,-4,52864,, +FI28S,Total loan amount of open finance installment loans verified in past 12 months,int,0,999999999,fixed,25,percentile,0.99,unk,,,,,,,1,,,-1,0,0,25,97005,, +CV26,The percentage of accounts that went from active (balance > $0) to inactive ($0 balance) at any time within the past 12 months.,float,0,100,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,60,, +CTA17,Number of instances where a non-mortgage account was utilized more than 90% since the most recent account was opened,int,0,999,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,59,, +AUT201,Total payment ratio (payment made/minimum payment due) for auto loans over the past 1 month,float,0,50,fixed,0,percentile,0.99,unk,,,,,,,1,,,-1,0,0,0,25,, +AT35B,Average balance of open trades verified in past 12 months (excluding mortgage and home equity),int,0,999999999,fixed,0,percentile,0.99,unk,,,,,,,1,,,1,0,0,0,23594,, +AEPMAG05,The aggregate excess payment magnitude algorithm measures the degree of aggregate personal loan aggregate excess payment change over the last 24 months by considering the aggregate excess payment patterns. High indexes indicate a high degree of aggregate excess payment growth.,int,0,600,fixed,23,percentile,0.99,unk,,,,,,,1,,,-1,0,0,23,374,, +tuseqno_accid,Unique Applicant ID ,string,,,,,,,,,,,,,,0,1,,,0,0,,,, +is_model_A_pop,is_model_A_pop flag ,int,0,1,,0,,,,,,,,,,,,1,,0,0,,,, diff --git a/request_schema.json b/request_schema.json index 0967ef4..5d9766a 100644 --- a/request_schema.json +++ b/request_schema.json @@ -1 +1,567 @@ -{} +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "properties": { + "AEPMAG04": { + "type": ["number", "null"], + "description": "The aggregate excess payment magnitude algorithm measures the degree of aggregate retail aggregate excess payment change over the last 24 months by considering the aggregate excess payment patterns. High indexes indicate a high degree of aggregate excess payment growth." + }, + "AEPMAG05": { + "type": ["number", "null"], + "description": "The aggregate excess payment magnitude algorithm measures the degree of aggregate personal loan aggregate excess payment change over the last 24 months by considering the aggregate excess payment patterns. High indexes indicate a high degree of aggregate excess payment growth." + }, + "AGG402": { + "type": ["number", "null"], + "description": "Total non-mortgage actual payment amount for month 2. AGG401 is the aggregate non-mortgage actual" + }, + "AGG403": { + "type": ["number", "null"], + "description": "Total non-mortgage actual payment amount for month 3. AGG401 is the aggregate non-mortgage actual" + }, + "AGG423": { + "type": ["number", "null"], + "description": "Total non-mortgage actual payment amount for month 23. AGG401 is the aggregate non-mortgage actual" + }, + "AGG424": { + "type": ["number", "null"], + "description": "Total non-mortgage actual payment amount for month 24. AGG401 is the aggregate non-mortgage actual" + }, + "AGG512": { + "type": ["number", "null"], + "description": "Total bankcard balance for month 12. AGG501 is the aggregate bankcard balance reported" + }, + "AGG516": { + "type": ["number", "null"], + "description": "Total bankcard balance for month 16. AGG501 is the aggregate bankcard balance reported" + }, + "AGG902": { + "type": ["number", "null"], + "description": "This algorithm counts the number of monthly aggregate non-mortgage balance decreases over the last 3 months." + }, + "AGG903": { + "type": ["number", "null"], + "description": "This algorithm counts the number of monthly aggregate non-mortgage credit limit increases over the last 3 months." + }, + "AT01S": { + "type": ["number", "null"], + "description": "Number of trades" + }, + "AT104S": { + "type": ["number", "null"], + "description": "Ratio of all trades opened in past 24 months to all trades" + }, + "AT35B": { + "type": ["number", "null"], + "description": "Average balance of open trades verified in past 12 months (excluding mortgage and home equity)" + }, + "AT36SD": { + "type": ["number", "null"], + "description": "Months since most recent delinquency" + }, + "AU20S": { + "type": ["number", "null"], + "description": "Months since oldest auto trade opened" + }, + "AUT201": { + "type": ["number", "null"], + "description": "Total payment ratio (payment made/minimum payment due) for auto loans over the past 1 month" + }, + "BALMAG01": { + "type": ["number", "null"], + "description": "The balance magnitude algorithm measures the degree of aggregate non-mortgage balance change over the last 24 months by considering the balance" + }, + "BI21S": { + "type": ["number", "null"], + "description": "Months since most recent bank installment trade opened" + }, + "BR33S": { + "type": ["number", "null"], + "description": "Total balance of open bank revolving trades verified in past 12 months" + }, + "CO06S": { + "type": ["number", "null"], + "description": "Total balance of trades that charged off in the past 12 months" + }, + "CT321": { + "type": ["number", "null"], + "description": "Number of payments made on each account since the last 30 days past due rating" + }, + "CTA17": { + "type": ["number", "null"], + "description": "Number of instances where a non-mortgage account was utilized more than 90% since the most recent account was opened" + }, + "CTA18": { + "type": ["number", "null"], + "description": "Number of balance increases for non-mortgage accounts in the last 3 months. Increases are measured on a month-over-month basis for each account over the most recent 3 months since most recent account was opened" + }, + "CTC20": { + "type": ["number", "null"], + "description": "Number of payments made on each account over the most recent 3 months since the last derogatory. Note: Derogatory is defined as non-medical collection, charge-off, repossession, foreclosure, or bankruptcy" + }, + "CTM18": { + "type": ["number", "null"], + "description": "Number of balance increases for non-mortgage accounts in the last 3 months. Increases are measured on a month-over-month basis for each account over the most recent 3 months for consumers who have moved. Note: Move date is the latest update to the primary address of the consumer" + }, + "CTM23": { + "type": ["number", "null"], + "description": "Number of months since move date Note: Move date is the latest update to the primary address of the consumer" + }, + "CV13": { + "type": ["number", "null"], + "description": "The percentage of total accounts that have ever been 30 or more days past due" + }, + "CV25": { + "type": ["number", "null"], + "description": "The percentage of accounts that went from inactive ($0 balance) to active (balance > $0) at any time within the past 12 months." + }, + "CV26": { + "type": ["number", "null"], + "description": "The percentage of accounts that went from active (balance > $0) to inactive ($0 balance) at any time within the past 12 months." + }, + "G230S": { + "type": ["number", "null"], + "description": "Number of 60 or more days past due trades (current MOP only) with balance > $0 opened in past 24 months" + }, + "FI02S": { + "type": ["number", "null"], + "description": "Number of open finance installment loans" + }, + "FI03S": { + "type": ["number", "null"], + "description": "Number of currently satisfactory open finance installment loans. Note: Satisfactory means MOP = 01" + }, + "FI101S": { + "type": ["number", "null"], + "description": "Total balance of all finance installment loans verified in past 12 months. Note: Includes both open and closed finance installment loans" + }, + "FI20S": { + "type": ["number", "null"], + "description": "Months since oldest finance installment loan opened" + }, + "FI28S": { + "type": ["number", "null"], + "description": "Total loan amount of open finance installment loans verified in past 12 months" + }, + "FI32S": { + "type": ["number", "null"], + "description": "Maximum current balance owed on open finance installment loans verified in past 12 months" + }, + "FI33S": { + "type": ["number", "null"], + "description": "Total balance of open finance installment loans verified in past 12 months" + }, + "FI34S": { + "type": ["number", "null"], + "description": "Utilization for open finance installment loans verified in past 12 months" + }, + "FI35S": { + "type": ["number", "null"], + "description": "Average balance of open finance installment loans verified in past 12 months" + }, + "FI36SD": { + "type": ["number", "null"], + "description": "Months since most recent finance installment delinquency" + }, + "FR21S": { + "type": ["number", "null"], + "description": "Months since most recent finance revolving trade opened" + }, + "FR32S": { + "type": ["number", "null"], + "description": "Maximum current balance owed on open finance revolving trades verified in past 12 months" + }, + "G020S": { + "type": ["number", "null"], + "description": "Number of trades with maximum delinquency of 30 days past due occurring in past 24 months" + }, + "G051S": { + "type": ["number", "null"], + "description": "Percentage of trades ever delinquent" + }, + "G102S": { + "type": ["number", "null"], + "description": "Months since most recent inquiry" + }, + "G106S": { + "type": ["number", "null"], + "description": "Months on file" + }, + "G205B": { + "type": ["number", "null"], + "description": "Total monthly obligation for individual account verified in past 12 months and with a current balance > 0" + }, + "G205S": { + "type": ["number", "null"], + "description": "Total monthly obligation (minimum payment due) for individual accounts verified in past 12 months. Note: Excludes joint accounts. Note: Sum of payment due amounts (no calculations/inferences)" + }, + "G210S": { + "type": ["number", "null"], + "description": "Total past due amount of charged-off trades verified in past 12 months" + }, + "G213A": { + "type": ["number", "null"], + "description": "Highest balance of third party collections verified in 24 months" + }, + "G218A": { + "type": ["number", "null"], + "description": "Number of trades verified in the past 12 months that are currently 30 days past due" + }, + "G225S": { + "type": ["number", "null"], + "description": "Total past due amount of currently 90 or more days past due trades" + }, + "G234S": { + "type": ["number", "null"], + "description": "Number of days with inquiry occurring in past 30 days" + }, + "G250BD": { + "type": ["number", "null"], + "description": "Number of 30 days past due or worse items in the past 12 months (excluding medical collection items)" + }, + "G250CD": { + "type": ["number", "null"], + "description": "Number of 30 days past due or worse items in the past 24 months (excluding medical collection items)" + }, + "G300S": { + "type": ["number", "null"], + "description": "Worst rating on credit cards in past 12 months: 0 No rating available,1 Paid or paying as agreed, 2 30 days past due, 3 60 days past due, 4 90 days past due, 5 120 days pastdue, 8 Repossession/Surrender, 9 Charged Off as Bad Debt/Collection, 10 Bankruptc" + }, + "G301S": { + "type": ["number", "null"], + "description": "Worst rating on credit cards: 0 No rating available, 1 Paid or paying as agreed, 2 30 days past due, 3 60 days past due, 4 90 days past due, 5 120 days past due, 8 repossession/Surrender, 9 Charged Off as Bad Debt/Collection, 10 Bankruptcy" + }, + "G404S": { + "type": ["number", "null"], + "description": "Number of deduped finance inquiries in past 3 months" + }, + "G405S": { + "type": ["number", "null"], + "description": "Number of deduped finance inquiries in past 6 months" + }, + "G406S": { + "type": ["number", "null"], + "description": "Number of deduped finance inquiries in past 12 months" + }, + "G407S": { + "type": ["number", "null"], + "description": "Number of deduped finance inquiries" + }, + "G416S": { + "type": ["number", "null"], + "description": "Months since most recent finance inquiry" + }, + "G417S": { + "type": ["number", "null"], + "description": "Months since most recent bank inquiry" + }, + "G990S": { + "type": ["number", "null"], + "description": "Number of deduped inquiries in past 12 months" + }, + "IN02S": { + "type": ["number", "null"], + "description": "Number of open installment loans" + }, + "IN12S": { + "type": ["number", "null"], + "description": "Number of open installment loans verified in past 12 months" + }, + "INAP01": { + "type": ["number", "null"], + "description": "Total scheduled monthly payment for open installment loans verified in past 12 months. Note: If monthly payment amount is missing, it will be imputed" + }, + "INST_TRD": { + "type": ["number", "null"], + "description": "Number of installment loans" + }, + "JT20S": { + "type": ["number", "null"], + "description": "Months since oldest joint trade opened" + }, + "JT33S": { + "type": ["number", "null"], + "description": "Total balance of joint trades in the last 12 months" + }, + "JT70S": { + "type": ["number", "null"], + "description": "Ratio of dollars past due joint trades to total dollars past due trades" + }, + "LQA232YR": { + "type": ["number", "null"], + "description": "Percent change in aggregate excess payment from months 13-15 to months 1-3" + }, + "LQR325YR": { + "type": ["number", "null"], + "description": "Percent change in average aggregate open-to-buy for revolving accounts from months 13-15 to months 1-3" + }, + "MT21S": { + "type": ["number", "null"], + "description": "Months since most recent mortgage trade opened" + }, + "NOMT_TRD": { + "type": ["number", "null"], + "description": "Number of non-mortgage tradelines" + }, + "OF09S": { + "type": ["number", "null"], + "description": "Number of credit union trades opened in past 24 months" + }, + "OF20S": { + "type": ["number", "null"], + "description": "Months since oldest credit union trade opened" + }, + "OF21S": { + "type": ["number", "null"], + "description": "Months since most recent credit union trade opened" + }, + "OF29S": { + "type": ["number", "null"], + "description": "Number of open credit union trades with balance > $0 verified in past 12 months" + }, + "OF35S": { + "type": ["number", "null"], + "description": "Average balance of open credit union trades verified in past 12 months" + }, + "PAYMNT06": { + "type": ["number", "null"], + "description": "The ratio of the sum of all payments to the sum of all the minimum monthly obligations reported in the last 6 months for installment accounts." + }, + "PAYMNT07": { + "type": ["number", "null"], + "description": "The ratio of the total payments to total minimum obligations for non-mortgage accounts this month" + }, + "PDMAG01": { + "type": ["number", "null"], + "description": "The past due magnitude algorithm measures the degree of aggregate non-mortgage past due amount change over the last 24 months by considering the past due amount patterns. High indexes indicate a high degree of past due amount growth." + }, + "PER201": { + "type": ["number", "null"], + "description": "Total payment ratio for personal loans over the past month" + }, + "PER202": { + "type": ["number", "null"], + "description": "Total payment ratio for personal loans over the past 3 months" + }, + "PER203": { + "type": ["number", "null"], + "description": "Total payment ratio for personal loans over the past 6 months" + }, + "PER204": { + "type": ["number", "null"], + "description": "Total payment ratio for personal loans over the past 12 months" + }, + "PER205": { + "type": ["number", "null"], + "description": "Total payment ratio for personal loans over the past 24 months" + }, + "PER222": { + "type": ["number", "null"], + "description": "Average payment ratio for personal loans over the past 3 months" + }, + "PER223": { + "type": ["number", "null"], + "description": "Average payment ratio for personal loans over the past 6 months" + }, + "PER224": { + "type": ["number", "null"], + "description": "Average payment ratio for personal loans over the past 12 months" + }, + "PER225": { + "type": ["number", "null"], + "description": "Average payment ratio for personal loans over the past 24 months" + }, + "PER235": { + "type": ["number", "null"], + "description": "Aggregate excess payment for personal loans over the past 24 months" + }, + "PER253": { + "type": ["number", "null"], + "description": "Average aggregate excess payment for personal loans over the past 6 months" + }, + "RE32S": { + "type": ["number", "null"], + "description": "Maximum current balance owed on open revolving trades verified in past 12 months" + }, + "RE36SD": { + "type": ["number", "null"], + "description": "Months since most recent revolving delinquency" + }, + "RET201": { + "type": ["number", "null"], + "description": "Total payment ratio (payment made/minimum payment due) for retail accounts over the past 1 month" + }, + "RLE902": { + "type": ["number", "null"], + "description": "Number of over-payments on real estate accounts in the past 12 months" + }, + "RLE907": { + "type": ["number", "null"], + "description": "Months since most recent over-payment on a real estate account" + }, + "RT20S": { + "type": ["number", "null"], + "description": "Months since oldest retail trade opened" + }, + "RT36S": { + "type": ["number", "null"], + "description": "Months since most recent retail delinquency. Note: Delinquency is defined as 30 days past due or worse" + }, + "RTL_TRD": { + "type": ["number", "null"], + "description": "Number of retail tradelines" + }, + "RVDEXQ2": { + "type": ["number", "null"], + "description": "Aggregate Q2(Quarter 2) revolving spend relative to annual revolving spend" + }, + "RVLR14": { + "type": ["string", "null"], + "description": "Revolver/Transactor/Inactive pattern for months 1 through 8 for Bankcard 1.(Note: Bankcard 1 is defined as the bankcard with the highest balance in the current month.)" + }, + "S204S": { + "type": ["number", "null"], + "description": "Total balance of third party collections verified in past 12 months" + }, + "SC20S": { + "type": ["number", "null"], + "description": "Months since oldest secured card opened" + }, + "SC21S": { + "type": ["number", "null"], + "description": "Months since most recent secured card opened" + }, + "SCBALM01": { + "type": ["number", "null"], + "description": "Secured Card balance magnitude ( balance change over last 24 months)" + }, + "SCC92": { + "type": ["number", "null"], + "description": "Number of months in the past 12 months where percentage of secured cards utilized less than 25% was more than 25%" + }, + "SE02S": { + "type": ["number", "null"], + "description": "Number of open secured installment loans" + }, + "SE06S": { + "type": ["number", "null"], + "description": "Number of secured installment loans opened in past 6 months" + }, + "SE09S": { + "type": ["number", "null"], + "description": "Number of secured installment loans opened in past 24 months" + }, + "SE20S": { + "type": ["number", "null"], + "description": "Months since oldest secured installment loan opened" + }, + "SE21CD": { + "type": ["number", "null"], + "description": "Months since most recent unpaid secured installment 120+ dpd or worse trade reported as closed" + }, + "SE21S": { + "type": ["number", "null"], + "description": "Months since most recent secured installment loan opened" + }, + "SE34S": { + "type": ["number", "null"], + "description": "Utilization for open secured installment loans verified in past 12 months" + }, + "SE36S": { + "type": ["number", "null"], + "description": "Months since most recent secured installment loan delinquency. Note: Delinquency is defined as 30 days past due or worse" + }, + "SE36SD": { + "type": ["number", "null"], + "description": "Months since most recent secured installment delinquency" + }, + "ST01S": { + "type": ["number", "null"], + "description": "Number of student loan trades Note: Includes deferred" + }, + "TRV03": { + "type": ["number", "null"], + "description": "The number of non-mortgage account balance increases from last month to the current month." + }, + "TRV04": { + "type": ["number", "null"], + "description": "The number of balance increases for non-mortgage accounts over the last 3 months. Increases are measured on a month-over-month basis for each" + }, + "TRV06": { + "type": ["number", "null"], + "description": "The number of months with at least one nonmortgage account balance increase over the last 12 months. If multiple accounts have a balance increase" + }, + "TRV10": { + "type": ["number", "null"], + "description": "The number of months with at least one nonmortgage account balance decrease over the last 12 months. If multiple accounts have a balance" + }, + "US01S": { + "type": ["number", "null"], + "description": "Number of unsecured installment loans" + }, + "US02S": { + "type": ["number", "null"], + "description": "Number of open unsecured installment loans" + }, + "US03S": { + "type": ["number", "null"], + "description": "Number of currently satisfactory open unsecured installment loans. Note: Satisfactory means MOP = 01" + }, + "US101S": { + "type": ["number", "null"], + "description": "Total balance of all unsecured installment loans verified in past 12 months" + }, + "US12S": { + "type": ["number", "null"], + "description": "Number of open unsecured installment loans verified in past 12 months" + }, + "US20S": { + "type": ["number", "null"], + "description": "Months since oldest unsecured installment loan opened" + }, + "US24S": { + "type": ["number", "null"], + "description": "Number of currently open and satisfactory unsecured installment loans 6 months or older. Note: Satisfactory means MOP = 01" + }, + "US28S": { + "type": ["number", "null"], + "description": "Total loan amount of open unsecured installment loans verified in past 12 months" + }, + "US30S": { + "type": ["number", "null"], + "description": "Percentage of open unsecured installment loans that are greater than 50% utilized, verified in past 12 months" + }, + "US32S": { + "type": ["number", "null"], + "description": "Maximum current balance owed on open unsecured installment loans verified in past 12 months" + }, + "US34S": { + "type": ["number", "null"], + "description": "Utilization for open unsecured installment loans verified in past 12 months" + }, + "US35S": { + "type": ["number", "null"], + "description": "Average balance of open unsecured installment loans verified in past 12 months" + }, + "US36S": { + "type": ["number", "null"], + "description": "Months since most recent unsecured installment loan delinquency. Note: Delinquency is defined as 30 days past due or worse" + }, + "US36SD": { + "type": ["number", "null"], + "description": "Months since most recent unsecured installment delinquency" + }, + "US51A": { + "type": ["number", "null"], + "description": "Terms in months of most recent unsecured installment trade" + }, + "UTLMAG01": { + "type": ["number", "null"], + "description": "The utilization magnitude algorithm measures the degree of aggregate non-mortgage utilization change over the last 24 months by considering the utilization patterns. High indexes indicate a high degree of utilization growth." + }, + "score_results": { + "type": "number", + "description": "TruVision Trended New Account Score 2.0:Risk score focused on new account performance (Bad = 90+ dpd in 24 months)" + } + }, + "required": ["score_results"] +} diff --git a/requirements.txt b/requirements.txt index 0967ef4..8b13789 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -{} + diff --git a/response_schema.json b/response_schema.json index 0967ef4..2838865 100644 --- a/response_schema.json +++ b/response_schema.json @@ -1 +1,11 @@ -{} +{ + "$schema": "http://json-schema.org/draft-07/schema", + "type": "object", + "properties": { + "results": { + "type": ["array", "null"], + "items": {"type": "object"} + } + }, + "required": [] +} \ No newline at end of file diff --git a/test_block.py b/test_block.py new file mode 100644 index 0000000..6acfcf1 --- /dev/null +++ b/test_block.py @@ -0,0 +1,37 @@ +import unittest + +from block import __main__ + +input_json = {"US36SD": "999", "score_results": "603", "US20S": "119", "INST_TRD": "28", "PER201": "1", "G106S": "220", "AT104S": "8", "BALMAG01": "188", "TRV04": "5", "US51A": "12", "PER222": "1", "PER235": "1949", "FI36SD": "999", "IN02S": "1", "TRV03": "3", "G225S": "606", "AEPMAG05": "297", "G205B": "611", "IN12S": "1", "G210S": "-1", "US28S": "1449", "CTM18": "-8", "CV25": "0", "AT36SD": "6", "AT01S": "36", "INAP01": "175", "FI20S": "119", "RET201": "-2", "CV13": "3", "G218A": "0", "OF20S": "-1", "CV26": "3", "FI35S": "1225", "SC20S": "-1", "G234S": "-4", "US24S": "1", "G250CD": "1", "PER225": "1.51", "G205S": "611", "AGG403": "205", "AGG903": "1", "US35S": "1225", "US32S": "1225", "AGG423": "1344", "AGG424": "484", "G300S": "1", "G051S": "3", "RTL_TRD": "8", "US02S": "1", "G250BD": "1", "AGG402": "210", "RT20S": "114", "PER202": "1", "FI02S": "1", "SE20S": "-1", "US36S": "999", "G230S": "-1", "PAYMNT06": "1.31", "US34S": "85", "G020S": "11", "RE32S": "2384", "NOMT_TRD": "36", "CO06S": "-1", "FI34S": "85", "CTA17": "24", "BR33S": "1148", "AEPMAG04": "286", "G406S": "-4", "CT321": "65", "CTM23": "-8", "SE36S": "-1", "BI21S": "-1", "TRV06": "8", "RVDEXQ2": "9", "G213A": "-4", "AU20S": "-1", "CTC20": "-5", "OF35S": "-1", "SCC92": "-1", "PER224": "1.15", "FI101S": "1225", "S204S": "-4", "G404S": "-4", "AGG516": "1193", "US12S": "1", "CTA18": "5", "SE34S": "-1", "RT36S": "6", "FI32S": "1225", "RE36SD": "6", "SE21S": "-1", "RVLR14": "RTRRRRRR", "OF29S": "-1", "OF09S": "-1", "LQR325YR": "-255", "AGG512": "1169", "FI03S": "1", "FI33S": "1225", "G416S": "-4", "FR32S": "-1", "UTLMAG01": "112", "PER223": "1.31", "G990S": "-4", "US30S": "100", "G417S": "-4", "SCBALM01": "-1", "SC21S": "-1", "G301S": "1", "JT20S": "-1", "ST01S": "0", "PER203": "1.31", "RLE902": "-1", "JT33S": "-1", "G102S": "-4", "FR21S": "-1", "PAYMNT07": "1", "G405S": "-4", "SE36SD": "-1", "US03S": "1", "MT21S": "-1", "LQA232YR": "100", "OF21S": "-1", "G407S": "-4", "JT70S": "-1", "AGG902": "2", "US01S": "26", "SE02S": "-1", "AT35B": "1037", "US101S": "1225", "PDMAG01": "310", "PER204": "1.15", "PER205": "1.48", "SE21CD": "-1", "TRV10": "12", "PER253": "54", "FI28S": "1449", "RLE907": "-1", "SE06S": "-1", "AUT201": "-1", "SE09S": "-1"} + + +class TestBlock(unittest.TestCase): + def test_block_smoke_runs(self): + results = __main__(**input_json) + print(results) + + self.assertIsInstance(results, dict) + + # sanity on structure + self.assertIn("results", results) + self.assertIsInstance(results["results"], list) + self.assertGreater(len(results["results"]), 0) + + first = results["results"][0] + self.assertIsInstance(first, dict) + + # check keys exist + self.assertIn("model_a_features", first) + self.assertIn("model_b_features", first) + self.assertIn("model_t_features", first) + + # optional: check they're dicts (not None/str/etc.) + self.assertIsInstance(first["model_a_features"], dict) + self.assertIsInstance(first["model_b_features"], dict) + self.assertIsInstance(first["model_t_features"], dict) + + + + +if __name__ == "__main__": # pragma: no cover + unittest.main()