drdavidprivacy commited on
Commit
00340b2
·
verified ·
1 Parent(s): e3f85da

Upload 13 files

Browse files
README.md CHANGED
@@ -14,42 +14,42 @@ models:
14
  datasets:
15
  - drdavidprivacy/limitwise-data
16
  - drdavidprivacy/practicum-case-packs
17
- short_description: LimitWise v2, the signed model and its dossier
18
  ---
19
 
20
  # LimitWise v2: Corvana Bank
21
 
22
- **Governance analyst:** [YOUR NAME]
23
 
24
  **Program:** AI Governance Practicum, Track 1, cohort 1
25
 
26
- This page is the public home of a governed system. The model is LimitWise v2, the version the Chief AI Officer signed in Week 6. The app has three pages: the model (its fixed weights and three example accounts), monitoring (upload a monthly file and read it against the training file and the tripwires), and the dossier (the six documents below).
27
 
28
  ## The signed version
29
 
30
- - File: `limitwise_v2.pkl`, 18,636 bytes, SHA-256 `9010c6ff9746c5dbf9cebff4c746832864c4f2321d016cc5f3b226847882f705`
31
  - Recalibration object: `limitwise_v2_recalibrated.pkl`, 89,015 bytes, SHA-256 `b6508dfcc69ca108e3f08fc2be0843dab1d2517355970b8e622e52a34127ca37` (the isotonic recalibration the Week 6 memo ratified; the odds correction to the 3 percent book rate, 0.1089, is applied in the app)
32
  - Plain-language reasons: `reasons.csv` (one reason for every value of every input)
33
  - Operating point: the top 10 percent of the ranked file
34
  - Libraries: scikit-learn 1.9.1, fairlearn 0.15.0
35
  - Data: the remediated working file in the program's dataset repository, loaded by link, never copied here: https://huggingface.co/datasets/drdavidprivacy/practicum-case-packs/resolve/main/corvana_modeling_extract_remediated.csv (MD5 `f79f13a5119f78572e9f6cc3243ea6ae`)
36
 
37
- - Model repository (the model card and the weights): https://huggingface.co/drdavidprivacy/limitwise-model. Dataset repository (the datasheet and the remediation log): https://huggingface.co/datasets/drdavidprivacy/limitwise-data
38
 
39
- ## The dossier
 
40
 
41
- The six deliverables, in course order. Each opens in the browser.
42
- - [Use Case Assessment (Week 1)](docs/01_Use-Case-Assessment.pdf)
43
- - [EDA Observation Log (Week 2)](docs/02_EDA-Observation-Log.pdf)
44
- - [Dataset Datasheet (Week 3)](docs/03_Dataset-Datasheet.pdf)
45
- - [Model Selection Rationale (Week 4)](docs/04_Model-Selection-Rationale.pdf)
46
- - [Model Card (Week 6)](docs/05_Model-Card.pdf)
47
- - [Go/No-Go Decision Record (Week 7)](docs/06_Go-No-Go-Decision-Record.pdf)
48
 
49
  ## What this page is not
50
 
51
- A score says where a cardholder's record ranks on one list. It is not a decision about the cardholder. The decisions, and the conditions on them, are in the Go/No-Go Decision Record above.
52
 
53
  ## Source
54
 
55
- Built for the AI Governance Practicum (AI Governance Collective). The organization, the people, and the program are fictional. The data is a public dataset, remediated and documented in the dossier's datasheet.
 
14
  datasets:
15
  - drdavidprivacy/limitwise-data
16
  - drdavidprivacy/practicum-case-packs
17
+ short_description: LimitWise v2, the signed model and its repositories
18
  ---
19
 
20
  # LimitWise v2: Corvana Bank
21
 
22
+ **Kept by:** Tom Becker, AI Governance Lead. **Signed by:** Anika Rao, Chief AI Officer (Week 6 memo).
23
 
24
  **Program:** AI Governance Practicum, Track 1, cohort 1
25
 
26
+ This page is the public home of a governed system. The model is LimitWise v2, the version the Chief AI Officer signed in Week 6. The app has four tabs: one account (the three Week 6 cases and the record's own reasons), a batch upload (score and rank a file), monitoring (read a month against the reference file with Evidently's data-drift report), and the repositories (the links below).
27
 
28
  ## The signed version
29
 
30
+ - File: `limitwise_v2.pkl`, 18,636 bytes, SHA-256 `7842edc29acd316873ffa482db705ab2ea09427f8b4e1186436713d316de8ecb`
31
  - Recalibration object: `limitwise_v2_recalibrated.pkl`, 89,015 bytes, SHA-256 `b6508dfcc69ca108e3f08fc2be0843dab1d2517355970b8e622e52a34127ca37` (the isotonic recalibration the Week 6 memo ratified; the odds correction to the 3 percent book rate, 0.1089, is applied in the app)
32
  - Plain-language reasons: `reasons.csv` (one reason for every value of every input)
33
  - Operating point: the top 10 percent of the ranked file
34
  - Libraries: scikit-learn 1.9.1, fairlearn 0.15.0
35
  - Data: the remediated working file in the program's dataset repository, loaded by link, never copied here: https://huggingface.co/datasets/drdavidprivacy/practicum-case-packs/resolve/main/corvana_modeling_extract_remediated.csv (MD5 `f79f13a5119f78572e9f6cc3243ea6ae`)
36
 
37
+ ## Monitoring (Week 8)
38
 
39
+ - `limitwise_reference.csv`: the Week 6 test set, the file every month is read against.
40
+ - `limitwise_month_1.csv`, `_month_2.csv`, `_month_3.csv`: three monthly files. One has no drift, one has input drift the model shrugs off, one has input drift that moves the scores and the outcomes. Tab 3 runs Evidently's data-drift report on any of them, or on a file of your own.
41
 
42
+ ## The repositories
43
+
44
+ - Model repository (the model card, the signed file and its hash, the weights): https://huggingface.co/drdavidprivacy/limitwise-model
45
+ - Dataset repository (the datasheet and the remediation log): https://huggingface.co/datasets/drdavidprivacy/limitwise-data
46
+ - Portfolio page (the six deliverables as PDFs, the page each learner builds under their own name): https://huggingface.co/spaces/drdavidprivacy/corvana-portfolio
47
+ - Collection: https://huggingface.co/collections/drdavidprivacy/limitwise-governance-repository-6ae5ff9b374cab20b18250eb
 
48
 
49
  ## What this page is not
50
 
51
+ A score says where a cardholder's record ranks on one list. It is not a decision about the cardholder. The decisions, and the conditions on them, are on the portfolio page.
52
 
53
  ## Source
54
 
55
+ Built for the AI Governance Practicum (AI Governance Collective). The organization, the people, and the program are fictional. The data is a public dataset, remediated and documented in the dataset repository's datasheet.
app.py CHANGED
@@ -1,4 +1,4 @@
1
- """The public page of a governed system: the signed model, its monitoring page, and the dossier.
2
  Built for the AI Governance Practicum (AI Governance Collective). One app.py serves all three organizations; space_config.json says which."""
3
  import json, os, pickle, io, warnings
4
  import numpy as np, pandas as pd
@@ -26,7 +26,6 @@ RECAL = pickle.load(open(os.path.join(HERE, CFG["recal_file"]), "rb")) if CFG.ge
26
  REASONS = pd.read_csv(os.path.join(HERE, CFG["reasons_file"])) if CFG.get("reasons_file") else None
27
  EXAMPLES = pd.read_csv(os.path.join(HERE, "examples.csv"), keep_default_na=False)
28
  INPUTS, KEPT, SHARE = CFG["inputs"], CFG["kept"], CFG["share"]
29
- CAL_FLOOR = 25 # a calibration band is read only when it expects at least this many outcomes; a smaller band says nothing either way
30
  SPACE_ID = os.environ.get("SPACE_ID", "")
31
  WEEK6 = CFG["week6"]
32
 
@@ -66,13 +65,20 @@ def readable(col):
66
  if col.startswith(c + "_"): return f"{c} is {col[len(c) + 1:]}"
67
  return col
68
 
 
 
 
 
 
 
69
  def coerce(df):
70
- """Read a file the way the working file is read: numeric inputs as numbers, categorical inputs as text."""
 
71
  df = df.copy()
72
  for c in CFG["numeric"]:
73
  if c in df: df[c] = pd.to_numeric(df[c], errors="coerce")
74
  for c in CFG["categorical"]:
75
- if c in df: df[c] = df[c].astype(str)
76
  return df
77
 
78
  def groups_of(frame):
@@ -180,110 +186,90 @@ def score_batch(file, top_n):
180
  f"Showing the top **{int(top_n)}** by score (the team's capacity). The download carries every record with its score, rank, whether it is ranked in, and its own top reason.")
181
  return out.head(int(top_n)), msg, path
182
 
183
- # ----------------------------------------------------------------------------- tab 2: monitoring
184
- def psi(ref_shares, new_shares):
185
- keys = set(ref_shares) | set(new_shares); eps = 1e-4; v = 0.0
186
- for k in keys:
187
- a, b = max(ref_shares.get(k, 0.0), eps), max(new_shares.get(k, 0.0), eps); v += (b - a) * np.log(b / a)
188
- return float(v)
189
-
190
- def drift_table(df):
191
- rows = []
192
- for c in INPUTS:
193
- if c not in df.columns: continue
194
- watch = c in CFG["watch_fields"]
195
- if c in REF["numeric"]:
196
- r = REF["numeric"][c]; v = pd.to_numeric(df[c], errors="coerce"); edges = r["edges"]
197
- if len(edges) < 3: continue
198
- def shares(x):
199
- b = np.clip(np.searchsorted(edges, x, side="right") - 1, 0, len(edges) - 2); return {str(i): float((b == i).mean()) for i in range(len(edges) - 1)}
200
- ref_sh = r["shares"]; new_sh = shares(v.dropna().values)
201
- idx = psi(ref_sh, new_sh)
202
- rows.append(dict(input=c, kind="number", training_file=f"mean {r['mean']:,.2f}, median {r['median']:,.2f}", this_file=f"mean {v.mean():,.2f}, median {v.median():,.2f}", missing=int(v.isna().sum()), stability_index=round(idx, 3), reading=reading(idx), watched="yes" if watch else ""))
203
- elif c in REF["categorical"]:
204
- r = REF["categorical"][c]; vc = df[c].astype(str).value_counts(normalize=True); new_sh = {str(k): float(x) for k, x in vc.items()}
205
- idx = psi(r, new_sh); top_r = max(r, key=r.get); top_n = max(new_sh, key=new_sh.get) if new_sh else ""
206
- new_levels = [k for k in new_sh if k not in r]
207
- rows.append(dict(input=c, kind="category", training_file=f"most common {top_r} ({pct(r[top_r])})", this_file=f"most common {top_n} ({pct(new_sh.get(top_n, 0))})" + (f"; new levels: {', '.join(new_levels)}" if new_levels else ""),
208
- missing=int((df[c].astype(str) == "nan").sum()), stability_index=round(idx, 3), reading=reading(idx), watched="yes" if watch else ""))
209
- t = pd.DataFrame(rows)
210
- return t.sort_values(["watched", "stability_index"], ascending=[False, False]).reset_index(drop=True) if len(t) else t
211
-
212
- def reading(idx):
213
- return "stable" if idx < 0.10 else ("watch" if idx < 0.25 else "SHIFTED")
214
-
215
- def group_table(df, s, flag, y):
216
- """Each group's rate at the cut beside the Week 6 test-set reading and the tripwire. With outcomes: the ruled check (false alarm or miss). Without: the share ranked in."""
217
- G = groups_of(df); rows = []; check = CFG["group_check"]; line = CFG["group_tripwire"]
218
- if y is not None:
219
- pos, neg = y == 1, y == 0
220
- port = (((flag == 1) & neg).sum() / max(neg.sum(), 1)) if check == "false_alarm" else (((flag == 0) & pos).sum() / max(pos.sum(), 1))
221
- for gname in G.columns:
222
- d = CFG["groups"][gname]; order = [b[2] for b in d["bands"]] if "bands" in d else d.get("order", [])
223
- for lvl in sorted(G[gname].unique(), key=lambda s: (order.index(s) if s in order else len(order), str(s))):
224
- m = (G[gname] == lvl).values; n = int(m.sum())
225
- wk6 = REF["group_rates"].get(gname, {}).get(str(lvl), {})
226
- covered = n >= CFG["min_group"] # the memo's group floor, applied to the month's file
227
- if y is not None:
228
- rate = (((flag == 1) & neg & m).sum() / max((neg & m).sum(), 1)) if check == "false_alarm" else (((flag == 0) & pos & m).sum() / max((pos & m).sum(), 1))
229
- base = wk6.get("false_alarm" if check == "false_alarm" else "miss", np.nan)
230
- over = rate > port * (1 + line)
231
- result = (f"not judged (under the group floor of {CFG['min_group']:,})" if not covered else ("TRIP" if over else "inside the line"))
232
- rows.append({"group": gname, "level": lvl, "records this file": n, ("false alarm rate" if check == "false_alarm" else "miss rate"): pct(rate), "whole file": pct(port), "line": pct(port * (1 + line)), "Week 6 test set": pct(base) if base == base else "", "watched": "yes" if str(lvl) in CFG["watch_groups"] else "", "result": result})
233
- else:
234
- rate = float(flag[m].mean()); base = wk6.get("flagged_share", np.nan)
235
- rows.append({"group": gname, "level": lvl, "records this file": n, "share ranked in": pct(rate), "whole file": pct(SHARE), "Week 6 test set": pct(base) if base == base else "", "watched": "yes" if str(lvl) in CFG["watch_groups"] else "", "result": "no outcomes yet: share ranked in only" if covered else f"not judged (under the group floor of {CFG['min_group']:,})"})
236
- return pd.DataFrame(rows)
237
-
238
- def calibration_table(s, y):
239
- cal = CFG["calibration"]; rows = []
240
- for lo, hi, name in cal["bands"]:
241
- m = (s >= lo) & (s < hi)
242
- if m.sum() == 0: rows.append(dict(band=name, records=0, predicted="", observed="", gap_share_of_observed="", result="empty band")); continue
243
- mp, ob = float(s[m].mean()), float(y[m].mean()); gap = abs(mp - ob); expected = mp * m.sum()
244
- if expected < CAL_FLOOR: res = f"not read (fewer than {CAL_FLOOR} expected outcomes in the band)"
245
- else: res = "no outcomes in band" if ob == 0 else ("pass" if gap / ob <= cal["tripwire"] else "TRIP")
246
- rows.append(dict(band=name, records=int(m.sum()), predicted=pct(mp, 2), observed=pct(ob, 2), gap_share_of_observed=(pct(gap / ob, 1) if ob else ""), result=res))
247
- return pd.DataFrame(rows)
248
-
249
- def monitor(file):
250
- empty = (None, None, None)
251
- if file is None: return "Upload a monthly file: one row per " + CFG["unit"] + ", the model's input columns, the measurement fields, and the outcome column once it is known.", *empty
252
- try: df = coerce(pd.read_csv(file.name if hasattr(file, "name") else file, low_memory=False, keep_default_na=False, na_values=[]))
253
- except Exception as e: return f"Could not read the file: {e}", *empty
254
- missing = [c for c in INPUTS if c not in df.columns]
255
- if missing: return "The file is missing input columns: " + ", ".join(missing) + ". The job would hold this file out of the cycle (the input contract).", *empty
256
- s = score_frame(df); order = np.argsort(-s, kind="stable"); k = int(round(SHARE * len(df))); flag = np.zeros(len(df), int); flag[order[:k]] = 1
257
- y = (df[CFG["outcome"]].astype(str) == str(CFG["positive"])).astype(int).values if CFG["outcome"] in df.columns else None
258
- above_cut = float((s >= REF["cut_score"]).mean())
259
- L = [f"**File:** {len(df):,} {CFG['units']}, {df.shape[1]} columns. Outcome column `{CFG['outcome']}`: " + ("present, so the ruled checks run." if y is not None else "absent, so only the input and score readings run. Upload again when the outcomes are known."),
260
- f"**Scores:** mean {s.mean():.4f} (training-file positive rate {pct(REF['positive_rate'])}). {pct(above_cut)} of this file scores above the Week 6 cut of {REF['cut_score']:.4f}, against {pct(SHARE, 0)} by construction on the test set. The top {int(SHARE*100)} percent of this file is {k:,} {CFG['units']}.",
261
- f"**Inputs:** the stability index compares each input's distribution with the training file's ({REF['rows']:,} rows). Under 0.10 is stable, 0.10 to 0.25 is watch, over 0.25 is shifted. These lines are the usual working lines, provisional until the Week 8 monitoring plan sets the program's own. Watched fields: {CFG['watch_fields_label']}."]
262
- if y is not None:
263
- pos = y == 1
264
- L.append(f"**At the cut:** {int((flag & pos).sum()):,} of the {int(pos.sum()):,} {CFG['positive_label']} {CFG['units']} are ranked in ({pct((flag & pos).sum() / max(pos.sum(), 1))}); the whole-file {'false alarm' if CFG['group_check'] == 'false_alarm' else 'miss'} rate is the line every group is read against, plus {int(CFG['group_tripwire']*100)} percent ({CFG['memo_ref']}).")
265
- cal = calibration_table(s, y) if (CFG.get("calibration") and y is not None) else None
266
- if cal is not None:
267
- worst = [r for r in cal.result if r == "TRIP"]; read = [r for r in cal.result if r in ("TRIP", "pass")]
268
- L.append(f"**Calibration:** predicted against observed by score band, line {int(CFG['calibration']['tripwire']*100)} percent of observed. Bands that expect fewer than {CAL_FLOOR} outcomes are not read. " + (f"{len(read)} band(s) read, every one inside the line." if not worst else f"{len(worst)} of {len(read)} band(s) read are over the line: the calibration condition (ruling 1) is not met for this file."))
269
- return "\n\n".join(L), drift_table(df), group_table(df, s, flag, y), cal
270
-
271
- # ----------------------------------------------------------------------------- tab 4: the dossier
272
- def dossier_markdown():
273
- L = [f"## The dossier: {CFG['system']} at {CFG['org']}", "", "The six deliverables of the practicum, in course order. Each opens in the browser.", ""]
274
- for f, label in CFG["docs"]:
275
- p = os.path.join(HERE, "docs", f)
276
- if SPACE_ID: url = f"https://huggingface.co/spaces/{SPACE_ID}/resolve/main/docs/{f}"
277
- else: url = f"docs/{f}"
278
- L.append(f"- [{label}]({url})" + ("" if os.path.exists(p) else " (not uploaded yet)"))
279
- L += ["", f"**Monitoring targets from the {CFG['memo_ref']}:**"] + [f"- {m}" for m in CFG["monitoring_lines"]]
280
  L += ["", f"**Data:** [{CFG['data_file']}]({CFG['data_url']}) in the program's dataset repository (MD5 `{CFG['md5']}`). The data is not copied into this page."]
281
  return "\n".join(L)
282
 
283
  # ----------------------------------------------------------------------------- the page
284
  INTRO = f"""
285
  # {CFG['system']} {CFG['version']}: {CFG['org']}
286
- **Governance analyst: [YOUR NAME]** · a teaching deployment for the *AI Governance Practicum*, Track 1
287
 
288
  ---
289
 
@@ -320,7 +306,7 @@ with gr.Blocks(title=f"{CFG['org']} {CFG['system']}") as demo:
320
  score_btn.click(score_one, ordered, [out_md, out_plot])
321
 
322
  with gr.Tab("2 · Batch upload"):
323
- gr.Markdown(f"Upload a CSV of {CFG['units']} (the same columns as the working file). {CFG['system']} scores every row, ranks the file, and marks the top {int(SHARE*100)} percent, the operating point the {CFG['memo_ref']} set. Top-N is how many of the ranked list the team can work. `sample_month.csv` in this repository is a file to try.")
324
  with gr.Row():
325
  up = gr.File(label=f"{CFG['units'].capitalize()} CSV", file_types=[".csv"])
326
  with gr.Column():
@@ -330,17 +316,17 @@ with gr.Blocks(title=f"{CFG['org']} {CFG['system']}") as demo:
330
  batch_btn.click(score_batch, [up, topn], [batch_tbl, batch_msg, batch_dl])
331
 
332
  with gr.Tab("3 · Monitoring"):
333
- gr.Markdown(f"**One month at a time.** Upload the month's file. The page reads it against the training file and the tripwires the {CFG['memo_ref']} set: the inputs' distributions, the scores, the groups at the cut, " + ("and the calibration table." if CFG.get("calibration") else "and the ruled group check.") + f" `sample_month.csv` in this repository is a stand-in drawn from the Week 6 test set, so the page can be tried before a monthly file exists.")
334
- mf = gr.File(label="Monthly file (CSV)", file_types=[".csv"])
335
- mon_btn = gr.Button("Read this month", variant="primary")
 
 
336
  m_msg = gr.Markdown()
337
- m_drift = gr.Dataframe(interactive=False, label="Inputs against the training file", wrap=True)
338
- m_groups = gr.Dataframe(interactive=False, label="Groups at the cut, against the whole file and the line", wrap=True)
339
- m_cal = gr.Dataframe(interactive=False, label="Calibration by score band", visible=bool(CFG.get("calibration")))
340
- mon_btn.click(monitor, mf, [m_msg, m_drift, m_groups, m_cal])
341
-
342
- with gr.Tab("4 · The dossier"):
343
- gr.Markdown(dossier_markdown())
344
 
345
  gr.Markdown(f"---\n*{CFG['system']} is a fictional model built on a public dataset for the AI Governance Practicum (AI Governance Collective). The organization, the people, and the program are fictional. Data: [{CFG['data_file']}]({CFG['data_url']}).*")
346
 
 
1
+ """The public page of a governed system: the signed model, its monitoring page, and the links to its repositories.
2
  Built for the AI Governance Practicum (AI Governance Collective). One app.py serves all three organizations; space_config.json says which."""
3
  import json, os, pickle, io, warnings
4
  import numpy as np, pandas as pd
 
26
  REASONS = pd.read_csv(os.path.join(HERE, CFG["reasons_file"])) if CFG.get("reasons_file") else None
27
  EXAMPLES = pd.read_csv(os.path.join(HERE, "examples.csv"), keep_default_na=False)
28
  INPUTS, KEPT, SHARE = CFG["inputs"], CFG["kept"], CFG["share"]
 
29
  SPACE_ID = os.environ.get("SPACE_ID", "")
30
  WEEK6 = CFG["week6"]
31
 
 
65
  if col.startswith(c + "_"): return f"{c} is {col[len(c) + 1:]}"
66
  return col
67
 
68
+ _ENC = MODEL.named_steps[MODEL.steps[0][0]]
69
+ _CAT_KIND = {}
70
+ for _name, _trans, _cols in _ENC.transformers_:
71
+ if _name == "cat":
72
+ for _c, _cats in zip(_cols, _trans.categories_): _CAT_KIND[_c] = "num" if np.issubdtype(np.asarray(_cats).dtype, np.number) else "str"
73
+
74
  def coerce(df):
75
+ """Read a file the way the working file was read when the model was fitted: numeric inputs as numbers, categorical inputs as text,
76
+ except the coded categoricals the encoder learned as numbers (a code column read from a CSV as text would otherwise be unknown to it)."""
77
  df = df.copy()
78
  for c in CFG["numeric"]:
79
  if c in df: df[c] = pd.to_numeric(df[c], errors="coerce")
80
  for c in CFG["categorical"]:
81
+ if c in df: df[c] = pd.to_numeric(df[c], errors="coerce") if _CAT_KIND.get(c) == "num" else df[c].astype(str)
82
  return df
83
 
84
  def groups_of(frame):
 
186
  f"Showing the top **{int(top_n)}** by score (the team's capacity). The download carries every record with its score, rank, whether it is ranked in, and its own top reason.")
187
  return out.head(int(top_n)), msg, path
188
 
189
+ # ----------------------------------------------------------------------------- tab 3: monitoring (Evidently)
190
+ import html as _html
191
+ REFERENCE = pd.read_csv(os.path.join(HERE, f"{CFG['short']}_reference.csv"), low_memory=False, keep_default_na=False, na_values=[])
192
+ MONTHS = {f"Month {i}": f"{CFG['short']}_month_{i}.csv" for i in (1, 2, 3) if os.path.exists(os.path.join(HERE, f"{CFG['short']}_month_{i}.csv"))}
193
+ SCORE_COL, FLAG_COL = "predicted_score", "flagged"
194
+
195
+ def monitoring_frame(df):
196
+ """The columns Evidently reads: every field in the file except the identifier, plus the model's score and the flag. Numbers as numbers, text as text."""
197
+ df = coerce(df); out = pd.DataFrame(index=df.index)
198
+ skip = {CFG.get("id_col")} | {SCORE_COL, FLAG_COL}
199
+ num, cat = [], []
200
+ for c in df.columns:
201
+ if c in skip or c is None: continue
202
+ if c in CFG["numeric"] or (c not in CFG["categorical"] and pd.api.types.is_numeric_dtype(df[c]) and c != CFG["outcome"]):
203
+ out[c] = pd.to_numeric(df[c], errors="coerce").astype("float64").to_numpy(); num.append(c)
204
+ else:
205
+ out[c] = df[c].astype(str).to_numpy().astype(object); cat.append(c)
206
+ s = score_frame(df); out[SCORE_COL] = s.astype("float64"); num.append(SCORE_COL)
207
+ out[FLAG_COL] = np.where(s >= REF["cut_score"], "flagged", "not flagged").astype(object); cat.append(FLAG_COL)
208
+ return out, num, cat
209
+
210
+ def monitor(choice, file):
211
+ """Run Evidently's data-drift report for one month against the reference file, and summarize the three signals above it."""
212
+ if file is not None:
213
+ try: cur = pd.read_csv(file.name if hasattr(file, "name") else file, low_memory=False, keep_default_na=False, na_values=[]); label = "your file"
214
+ except Exception as e: return f"Could not read the file: {e}", "", None
215
+ elif choice in MONTHS:
216
+ cur = pd.read_csv(os.path.join(HERE, MONTHS[choice]), low_memory=False, keep_default_na=False, na_values=[]); label = choice
217
+ else:
218
+ return "Pick a month, or upload a file.", "", None
219
+ missing = [c for c in INPUTS if c not in cur.columns]
220
+ if missing: return "The file is missing input columns: " + ", ".join(missing) + ". Nothing was read.", "", None
221
+ from evidently import Dataset, DataDefinition, Report
222
+ from evidently.presets import DataDriftPreset
223
+ ref_f, num, cat = monitoring_frame(REFERENCE)
224
+ cur_f, num_c, cat_c = monitoring_frame(cur)
225
+ cols = [c for c in ref_f.columns if c in cur_f.columns]
226
+ num = [c for c in num if c in cols]; cat = [c for c in cat if c in cols]
227
+ dd = DataDefinition(numerical_columns=num, categorical_columns=cat)
228
+ # two-sided proportion test for the yes/no columns (the flag and the outcome), where a distance score reads a real shift as small
229
+ binary = [c for c in (FLAG_COL, CFG["outcome"]) if c in cat]
230
+ preset = DataDriftPreset(per_column_method={c: "z" for c in binary}, per_column_threshold={c: 0.05 for c in binary})
231
+ snap = Report([preset]).run(Dataset.from_pandas(cur_f[cols], data_definition=dd), Dataset.from_pandas(ref_f[cols], data_definition=dd))
232
+ ms = snap.dict()["metrics"]
233
+ def is_drift(m):
234
+ c = m.get("config", {}); col = c.get("column")
235
+ if not col: return False
236
+ if col in binary: return float(m["value"]) < c.get("threshold", 0.05) # a p-value
237
+ return float(m["value"]) > c.get("threshold", 0.1) # a distance
238
+ drifted = [m["config"]["column"] for m in ms[1:] if is_drift(m)]
239
+ inputs_drifted = [c for c in drifted if c in INPUTS]; other_drifted = [c for c in drifted if c not in INPUTS and c not in (SCORE_COL, FLAG_COL, CFG["outcome"])]
240
+ s_ref, s_cur = ref_f[SCORE_COL].values, cur_f[SCORE_COL].values
241
+ f_ref, f_cur = float((s_ref >= REF["cut_score"]).mean()), float((s_cur >= REF["cut_score"]).mean())
242
+ L = [f"**{label}:** {len(cur):,} {CFG['units']} read against the reference file ({len(REFERENCE):,} {CFG['units']}, the Week 6 test set). Every column in the file is compared, plus the model's score and whether the {CFG['unit']} is flagged at the Week 6 cut.", ""]
243
+ L.append(f"**The inputs.** {len(inputs_drifted)} of {len(INPUTS)} input columns drifted" + (": " + ", ".join(inputs_drifted) + "." if inputs_drifted else ".") + (f" Other fields in the file that drifted (not model inputs): {', '.join(other_drifted)}." if other_drifted else ""))
244
+ L.append(f"**The scores.** Mean score {s_ref.mean():.4f} in the reference, {s_cur.mean():.4f} this month. Share flagged at the Week 6 cut: {pct(f_ref)} in the reference, {pct(f_cur)} this month." + (" The score column drifted." if SCORE_COL in drifted else " The score column did not drift."))
245
+ if CFG["outcome"] in cur.columns:
246
+ o_ref = float((REFERENCE[CFG["outcome"]].astype(str) == str(CFG["positive"])).mean()); o_cur = float((cur[CFG["outcome"]].astype(str) == str(CFG["positive"])).mean())
247
+ L.append(f"**The outcomes.** {CFG['positive_label'].capitalize()}: {pct(o_ref)} of the reference, {pct(o_cur)} this month." + (" The outcome column drifted." if CFG["outcome"] in drifted else " The outcome column did not drift."))
248
+ else:
249
+ L.append("**The outcomes.** This file carries no outcome column, so label drift cannot be read yet.")
250
+ L.append("\nThe full report is below (Evidently, data drift preset: Wasserstein distance for numbers, Jensen-Shannon distance for categories, drift called at 0.1, and a proportion test for the flag and the outcome). Download it as a page to keep with your monitoring read.")
251
+ report_html = snap.get_html_str(as_iframe=False)
252
+ path = os.path.join("/tmp", f"{CFG['short']}_{label.replace(' ', '_')}_evidently_report.html"); open(path, "w", encoding="utf-8").write(report_html)
253
+ frame = f'<iframe srcdoc="{_html.escape(report_html, quote=True)}" style="width:100%;height:1400px;border:1px solid #ddd;border-radius:8px;background:white"></iframe>'
254
+ return "\n".join(L), frame, path
255
+
256
+ # ----------------------------------------------------------------------------- tab 4: the repositories
257
+ def repositories_markdown():
258
+ short = CFG["short"]
259
+ L = [f"## The repositories: {CFG['system']} at {CFG['org']}", "",
260
+ "A governed system leaves its record in several places, and this page is only one of them. Each link opens on Hugging Face.", "",
261
+ f"- **Model repository**, [drdavidprivacy/{short}-model](https://huggingface.co/drdavidprivacy/{short}-model): the model card, the signed file and its SHA-256, and the fixed weights as a table. The card on the page is the AI Governance Lead's exemplar.",
262
+ f"- **Dataset repository**, [drdavidprivacy/{short}-data](https://huggingface.co/datasets/drdavidprivacy/{short}-data): the datasheet and the remediation log for the working file. The data itself is linked, not copied.",
263
+ f"- **Portfolio page**, [drdavidprivacy/{CFG['portfolio']}](https://huggingface.co/spaces/drdavidprivacy/{CFG['portfolio']}): the six deliverables of the practicum as PDFs, in course order, on a page with no code behind it. Each learner builds one of these under their own name.",
264
+ f"- **Collection**, [{CFG['collection_name']}]({CFG['collection_url']}): all of the above in one place.", ""]
265
+ L += [f"**Monitoring targets from the {CFG['memo_ref']}:**"] + [f"- {m}" for m in CFG["monitoring_lines"]]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
266
  L += ["", f"**Data:** [{CFG['data_file']}]({CFG['data_url']}) in the program's dataset repository (MD5 `{CFG['md5']}`). The data is not copied into this page."]
267
  return "\n".join(L)
268
 
269
  # ----------------------------------------------------------------------------- the page
270
  INTRO = f"""
271
  # {CFG['system']} {CFG['version']}: {CFG['org']}
272
+ **Kept by: {CFG['lead']}** · a teaching deployment for the *AI Governance Practicum*, Track 1
273
 
274
  ---
275
 
 
306
  score_btn.click(score_one, ordered, [out_md, out_plot])
307
 
308
  with gr.Tab("2 · Batch upload"):
309
+ gr.Markdown(f"Upload a CSV of {CFG['units']} (the same columns as the working file). {CFG['system']} scores every row, ranks the file, and marks the top {int(SHARE*100)} percent, the operating point the {CFG['memo_ref']} set. Top-N is how many of the ranked list the team can work. `{CFG['short']}_month_1.csv` in this repository is a file to try.")
310
  with gr.Row():
311
  up = gr.File(label=f"{CFG['units'].capitalize()} CSV", file_types=[".csv"])
312
  with gr.Column():
 
316
  batch_btn.click(score_batch, [up, topn], [batch_tbl, batch_msg, batch_dl])
317
 
318
  with gr.Tab("3 · Monitoring"):
319
+ gr.Markdown(f"**One month at a time.** Pick one of the three monthly files, or upload a file of your own, and read it against the reference file (the Week 6 test set). The page scores every row with the signed version and runs Evidently's data-drift report: every column in the file, the model's score, and the flag at the Week 6 cut. The three files and the reference are in this repository's Files tab (`{CFG['short']}_reference.csv`, `{CFG['short']}_month_1.csv` to `_3.csv`).")
320
+ with gr.Row():
321
+ m_choice = gr.Dropdown(choices=list(MONTHS), value=(list(MONTHS)[0] if MONTHS else None), label="Monthly file")
322
+ mf = gr.File(label="Or upload a file of your own (CSV)", file_types=[".csv"])
323
+ mon_btn = gr.Button("Run the monitoring report", variant="primary")
324
  m_msg = gr.Markdown()
325
+ m_dl = gr.File(label="Download the report (HTML)")
326
+ m_html = gr.HTML()
327
+ mon_btn.click(monitor, [m_choice, mf], [m_msg, m_html, m_dl])
328
+ with gr.Tab("4 · The repositories"):
329
+ gr.Markdown(repositories_markdown())
 
 
330
 
331
  gr.Markdown(f"---\n*{CFG['system']} is a fictional model built on a public dataset for the AI Governance Practicum (AI Governance Collective). The organization, the people, and the program are fictional. Data: [{CFG['data_file']}]({CFG['data_url']}).*")
332
 
limitwise_month_1.csv ADDED
The diff for this file is too large to render. See raw diff
 
limitwise_month_2.csv ADDED
The diff for this file is too large to render. See raw diff
 
limitwise_month_3.csv ADDED
The diff for this file is too large to render. See raw diff
 
limitwise_reference.csv ADDED
The diff for this file is too large to render. See raw diff
 
limitwise_v2.pkl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:9010c6ff9746c5dbf9cebff4c746832864c4f2321d016cc5f3b226847882f705
3
  size 18636
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7842edc29acd316873ffa482db705ab2ea09427f8b4e1186436713d316de8ecb
3
  size 18636
requirements.txt CHANGED
@@ -5,3 +5,4 @@ pandas>=2.2
5
  numpy>=1.26
6
  scipy>=1.11
7
  matplotlib>=3.8
 
 
5
  numpy>=1.26
6
  scipy>=1.11
7
  matplotlib>=3.8
8
+ evidently==0.7.23
space_config.json CHANGED
@@ -4,6 +4,9 @@
4
  "version": "v2",
5
  "short": "limitwise",
6
  "emoji": "\ud83d\udcb3",
 
 
 
7
  "model_file": "limitwise_v2.pkl",
8
  "recal_file": "limitwise_v2_recalibrated.pkl",
9
  "odds_factor": 0.1089,
@@ -24,6 +27,8 @@
24
  "book_size": 4600000,
25
  "capacity": 460000,
26
  "sample_rows": 4500,
 
 
27
  "groups": {
28
  "sex": {
29
  "col": "SEX",
@@ -303,7 +308,7 @@
303
  "artifacts": {
304
  "limitwise_v2.pkl": {
305
  "bytes": 18636,
306
- "sha256": "9010c6ff9746c5dbf9cebff4c746832864c4f2321d016cc5f3b226847882f705"
307
  },
308
  "limitwise_v2_recalibrated.pkl": {
309
  "bytes": 89015,
@@ -317,378 +322,378 @@
317
  "weights": [
318
  [
319
  "STATUS_2_delay of 8 months",
320
- -0.5039640117149762
321
  ],
322
  [
323
  "STATUS_0_delay of 2 months",
324
- 0.45516729018027985
325
  ],
326
  [
327
  "STATUS_0_no delinquency recorded, code undefined",
328
- -0.2954172202637042
329
  ],
330
  [
331
  "BILL_AMT1",
332
- -0.2228912520448836
333
  ],
334
  [
335
  "BILL_AMT2",
336
- 0.22269939281071544
337
  ],
338
  [
339
  "LIMIT_BAL",
340
- -0.18063967871686037
341
  ],
342
  [
343
  "STATUS_3_delay of 6 months",
344
- 0.17892881325853535
345
  ],
346
  [
347
  "STATUS_3_delay of 1 month",
348
- -0.16668021465775795
349
  ],
350
  [
351
  "PAY_AMT1",
352
- -0.1632487196724503
353
  ],
354
  [
355
  "STATUS_5_delay of 7 months",
356
- 0.15235838596976303
357
  ],
358
  [
359
  "STATUS_4_delay of 1 month",
360
- 0.1491325284806155
361
  ],
362
  [
363
  "STATUS_4_delay of 7 months",
364
- -0.14666812800930254
365
  ],
366
  [
367
  "STATUS_0_delay of 3 months",
368
- 0.13564225626643642
369
  ],
370
  [
371
  "STATUS_4_delay of 5 months",
372
- -0.13392612415669763
373
  ],
374
  [
375
  "UTIL_RECENT",
376
- 0.13305523847099887
377
  ],
378
  [
379
  "PAY_AMT2",
380
- -0.1311043767823986
381
  ],
382
  [
383
  "STATUS_4_delay of 6 months",
384
- -0.12287955900651147
385
  ],
386
  [
387
  "PAID_3_paid nothing",
388
- 0.1129184560500605
389
  ],
390
  [
391
  "PAID_4_paid part",
392
- -0.10724778086791321
393
  ],
394
  [
395
  "BILL_AMT3",
396
- 0.10585801182420128
397
  ],
398
  [
399
  "PAID_4_no balance",
400
- 0.10148095540407595
401
  ],
402
  [
403
  "BILL_AMT6",
404
- -0.09763006039107963
405
  ],
406
  [
407
  "PAID_1_paid part",
408
- -0.09056534298708994
409
  ],
410
  [
411
  "PAID_5_paid in full",
412
- -0.0892314829113721
413
  ],
414
  [
415
  "STATUS_3_delay of 2 months",
416
- 0.08860161449355075
417
  ],
418
  [
419
  "STATUS_6_no delinquency recorded, code undefined",
420
- -0.08077147095281419
421
  ],
422
  [
423
  "PAID_3_paid in full",
424
- -0.07626009416706608
425
  ],
426
  [
427
  "PAID_1_paid nothing",
428
- 0.07073519832080787
429
  ],
430
  [
431
  "BILL_AMT4",
432
- 0.06778067366978535
433
  ],
434
  [
435
  "STATUS_5_paid duly",
436
- -0.0666676426987248
437
  ],
438
  [
439
  "STATUS_5_delay of 2 months",
440
- 0.06417630056322528
441
  ],
442
  [
443
  "STATUS_3_paid duly",
444
- -0.058559384163120995
445
  ],
446
  [
447
  "PAID_5_paid nothing",
448
- 0.056609224967473996
449
  ],
450
  [
451
  "STATUS_2_paid duly",
452
- -0.05575862690635376
453
  ],
454
  [
455
  "STATUS_6_paid duly",
456
- 0.05198215483980206
457
  ],
458
  [
459
  "PAID_1_no balance",
460
- 0.051491683064460225
461
  ],
462
  [
463
  "STATUS_5_delay of 6 months",
464
- 0.05127020596505058
465
  ],
466
  [
467
  "PAID_2_paid nothing",
468
- 0.049888877167707624
469
  ],
470
  [
471
  "STATUS_4_delay of 2 months",
472
- 0.049861308512525224
473
  ],
474
  [
475
  "STATUS_6_delay of 3 months",
476
- 0.048227639441464555
477
  ],
478
  [
479
  "STATUS_2_delay of 7 months",
480
- -0.046987798012967534
481
  ],
482
  [
483
  "STATUS_0_delay of 1 month",
484
- 0.046007430318966855
485
  ],
486
  [
487
  "STATUS_0_delay of 4 months",
488
- 0.04594619115617008
489
  ],
490
  [
491
  "PAID_2_paid part",
492
- -0.045157988950279886
493
  ],
494
  [
495
  "STATUS_6_delay of 2 months",
496
- 0.04299847086557449
497
  ],
498
  [
499
  "STATUS_2_no delinquency recorded, code undefined",
500
- 0.04256803129213566
501
  ],
502
  [
503
  "STATUS_2_delay of 4 months",
504
- -0.04245810776944441
505
  ],
506
  [
507
  "PAID_5_paid part",
508
- 0.041324244530768196
509
  ],
510
  [
511
  "STATUS_0_paid duly",
512
- -0.04040908258957809
513
  ],
514
  [
515
  "STATUS_5_delay of 5 months",
516
- 0.04029083922104809
517
  ],
518
  [
519
  "STATUS_0_delay of 8 months",
520
- -0.03989328494696936
521
  ],
522
  [
523
  "PAID_4_paid nothing",
524
- 0.030239839145912967
525
  ],
526
  [
527
  "PAID_2_no balance",
528
- 0.029314204256443172
529
  ],
530
  [
531
  "STATUS_0_delay of 7 months",
532
- 0.027682360093350636
533
  ],
534
  [
535
  "BILL_AMT5",
536
- 0.026107426898704385
537
  ],
538
  [
539
  "STATUS_2_delay of 2 months",
540
- 0.02534368305881076
541
  ],
542
  [
543
  "STATUS_6_delay of 7 months",
544
- -0.025146023371866947
545
  ],
546
  [
547
  "STATUS_4_no delinquency recorded, code undefined",
548
- -0.022964362727131187
549
  ],
550
  [
551
  "PAID_1_paid in full",
552
- 0.022724009884953413
553
  ],
554
  [
555
  "PAID_4_paid in full",
556
- 0.02245439361926815
557
  ],
558
  [
559
  "STATUS_3_no delinquency recorded, code undefined",
560
- -0.02156581698858859
561
  ],
562
  [
563
  "STATUS_4_paid duly",
564
- 0.020762235094724073
565
  ],
566
  [
567
  "STATUS_6_delay of 4 months",
568
- 0.019296387382300217
569
  ],
570
  [
571
  "STATUS_4_delay of 3 months",
572
- -0.01923704382819946
573
  ],
574
  [
575
  "STATUS_2_delay of 1 month",
576
- -0.0172199614464832
577
  ],
578
  [
579
  "STATUS_5_delay of 4 months",
580
- -0.016779851959171352
581
  ],
582
  [
583
  "STATUS_3_delay of 3 months",
584
- 0.01648868042506778
585
  ],
586
  [
587
  "STATUS_2_delay of 5 months",
588
- 0.014957419997955653
589
  ],
590
  [
591
  "PAY_RATIO_RECENT",
592
- -0.014744579470871863
593
  ],
594
  [
595
  "STATUS_6_delay of 6 months",
596
- 0.013758271416478517
597
  ],
598
  [
599
  "PAID_3_no balance",
600
- -0.013308180700566758
601
  ],
602
  [
603
  "PAY_AMT4",
604
- -0.011886073530987376
605
  ],
606
  [
607
  "STATUS_3_delay of 4 months",
608
- -0.011652950623659085
609
  ],
610
  [
611
  "PAID_3_paid part",
612
- 0.011198662989123377
613
  ],
614
  [
615
  "STATUS_3_delay of 5 months",
616
- -0.010570088856279056
617
  ],
618
  [
619
  "PAY_AMT6",
620
- -0.010199223786032116
621
  ],
622
  [
623
  "PAY_AMT5",
624
- -0.010192317260560536
625
  ],
626
  [
627
  "STATUS_5_delay of 3 months",
628
- -0.008719319674889212
629
  ],
630
  [
631
  "STATUS_2_delay of 6 months",
632
- -0.006664589784760609
633
  ],
634
  [
635
  "PAY_AMT3",
636
- -0.005409485029026605
637
  ],
638
  [
639
  "STATUS_2_delay of 3 months",
640
- 0.00531500666845586
641
  ],
642
  [
643
  "STATUS_4_delay of 8 months",
644
- 0.005105130388909714
645
  ],
646
  [
647
  "STATUS_5_delay of 8 months",
648
- 0.005105130388909714
649
  ],
650
  [
651
  "STATUS_6_delay of 8 months",
652
- 0.005105130388909714
653
  ],
654
  [
655
  "STATUS_4_delay of 4 months",
656
- -0.0035510675474280744
657
  ],
658
  [
659
  "PAID_5_no balance",
660
- 0.0032224469206171293
661
  ],
662
  [
663
  "STATUS_0_delay of 5 months",
664
- 0.003219742092141661
665
  ],
666
  [
667
  "STATUS_6_delay of 5 months",
668
- 0.0022697250009204592
669
  ],
670
  [
671
  "STATUS_5_no delinquency recorded, code undefined",
672
- 0.002162756041293051
673
  ],
674
  [
675
  "STATUS_3_delay of 7 months",
676
- -0.0006486500787535714
677
  ],
678
  [
679
  "PAID_2_paid in full",
680
- -0.00031853078199528285
681
  ],
682
  [
683
  "STATUS_0_delay of 6 months",
684
- -0.0003018818995281281
685
  ],
686
  [
687
  "STATUS_3_delay of 8 months",
688
- -0.0001632837853126454
689
  ]
690
  ],
691
- "intercept": -0.23093874253017443,
692
  "data_url": "https://huggingface.co/datasets/drdavidprivacy/practicum-case-packs/resolve/main/corvana_modeling_extract_remediated.csv",
693
  "dataset_repo": "https://huggingface.co/datasets/drdavidprivacy/practicum-case-packs",
694
  "versions": {
 
4
  "version": "v2",
5
  "short": "limitwise",
6
  "emoji": "\ud83d\udcb3",
7
+ "portfolio": "corvana-portfolio",
8
+ "collection_name": "LimitWise Governance Repository",
9
+ "collection_url": "https://huggingface.co/collections/drdavidprivacy/limitwise-governance-repository-6ae5ff9b374cab20b18250eb",
10
  "model_file": "limitwise_v2.pkl",
11
  "recal_file": "limitwise_v2_recalibrated.pkl",
12
  "odds_factor": 0.1089,
 
27
  "book_size": 4600000,
28
  "capacity": 460000,
29
  "sample_rows": 4500,
30
+ "month_rows": 4000,
31
+ "month_seed": 11,
32
  "groups": {
33
  "sex": {
34
  "col": "SEX",
 
308
  "artifacts": {
309
  "limitwise_v2.pkl": {
310
  "bytes": 18636,
311
+ "sha256": "7842edc29acd316873ffa482db705ab2ea09427f8b4e1186436713d316de8ecb"
312
  },
313
  "limitwise_v2_recalibrated.pkl": {
314
  "bytes": 89015,
 
322
  "weights": [
323
  [
324
  "STATUS_2_delay of 8 months",
325
+ -0.5039640072953564
326
  ],
327
  [
328
  "STATUS_0_delay of 2 months",
329
+ 0.4551672900610481
330
  ],
331
  [
332
  "STATUS_0_no delinquency recorded, code undefined",
333
+ -0.29541722019909206
334
  ],
335
  [
336
  "BILL_AMT1",
337
+ -0.22289125235966772
338
  ],
339
  [
340
  "BILL_AMT2",
341
+ 0.22269939355880997
342
  ],
343
  [
344
  "LIMIT_BAL",
345
+ -0.18063967864614505
346
  ],
347
  [
348
  "STATUS_3_delay of 6 months",
349
+ 0.17892881317393983
350
  ],
351
  [
352
  "STATUS_3_delay of 1 month",
353
+ -0.1666802133117096
354
  ],
355
  [
356
  "PAY_AMT1",
357
+ -0.16324871972903526
358
  ],
359
  [
360
  "STATUS_5_delay of 7 months",
361
+ 0.15235838602958815
362
  ],
363
  [
364
  "STATUS_4_delay of 1 month",
365
+ 0.14913252735793928
366
  ],
367
  [
368
  "STATUS_4_delay of 7 months",
369
+ -0.14666812791171707
370
  ],
371
  [
372
  "STATUS_0_delay of 3 months",
373
+ 0.1356422562245205
374
  ],
375
  [
376
  "STATUS_4_delay of 5 months",
377
+ -0.13392612402039197
378
  ],
379
  [
380
  "UTIL_RECENT",
381
+ 0.13305523853156798
382
  ],
383
  [
384
  "PAY_AMT2",
385
+ -0.13110437667603564
386
  ],
387
  [
388
  "STATUS_4_delay of 6 months",
389
+ -0.12287955895658455
390
  ],
391
  [
392
  "PAID_3_paid nothing",
393
+ 0.11291845600022514
394
  ],
395
  [
396
  "PAID_4_paid part",
397
+ -0.10724778099203863
398
  ],
399
  [
400
  "BILL_AMT3",
401
+ 0.10585801079767654
402
  ],
403
  [
404
  "PAID_4_no balance",
405
+ 0.10148095550974805
406
  ],
407
  [
408
  "BILL_AMT6",
409
+ -0.09763006096339935
410
  ],
411
  [
412
  "PAID_1_paid part",
413
+ -0.09056534286569744
414
  ],
415
  [
416
  "PAID_5_paid in full",
417
+ -0.08923148289651153
418
  ],
419
  [
420
  "STATUS_3_delay of 2 months",
421
+ 0.08860161441479777
422
  ],
423
  [
424
  "STATUS_6_no delinquency recorded, code undefined",
425
+ -0.080771470924185
426
  ],
427
  [
428
  "PAID_3_paid in full",
429
+ -0.07626009426053693
430
  ],
431
  [
432
  "PAID_1_paid nothing",
433
+ 0.07073519837099726
434
  ],
435
  [
436
  "BILL_AMT4",
437
+ 0.0677806743545396
438
  ],
439
  [
440
  "STATUS_5_paid duly",
441
+ -0.06666764266580824
442
  ],
443
  [
444
  "STATUS_5_delay of 2 months",
445
+ 0.06417630050812508
446
  ],
447
  [
448
  "STATUS_3_paid duly",
449
+ -0.05855938417367776
450
  ],
451
  [
452
  "PAID_5_paid nothing",
453
+ 0.05660922499989594
454
  ],
455
  [
456
  "STATUS_2_paid duly",
457
+ -0.05575862688354833
458
  ],
459
  [
460
  "STATUS_6_paid duly",
461
+ 0.051982154815802435
462
  ],
463
  [
464
  "PAID_1_no balance",
465
+ 0.0514916828905529
466
  ],
467
  [
468
  "STATUS_5_delay of 6 months",
469
+ 0.051270206053641826
470
  ],
471
  [
472
  "PAID_2_paid nothing",
473
+ 0.04988887717888915
474
  ],
475
  [
476
  "STATUS_4_delay of 2 months",
477
+ 0.04986130866939965
478
  ],
479
  [
480
  "STATUS_6_delay of 3 months",
481
+ 0.048227639483102186
482
  ],
483
  [
484
  "STATUS_2_delay of 7 months",
485
+ -0.046987798245092256
486
  ],
487
  [
488
  "STATUS_0_delay of 1 month",
489
+ 0.04600743034304016
490
  ],
491
  [
492
  "STATUS_0_delay of 4 months",
493
+ 0.04594619106710718
494
  ],
495
  [
496
  "PAID_2_paid part",
497
+ -0.04515798904117099
498
  ],
499
  [
500
  "STATUS_6_delay of 2 months",
501
+ 0.04299847088182787
502
  ],
503
  [
504
  "STATUS_2_no delinquency recorded, code undefined",
505
+ 0.04256803115041107
506
  ],
507
  [
508
  "STATUS_2_delay of 4 months",
509
+ -0.04245810777257909
510
  ],
511
  [
512
  "PAID_5_paid part",
513
+ 0.04132424452731096
514
  ],
515
  [
516
  "STATUS_0_paid duly",
517
+ -0.04040908259405443
518
  ],
519
  [
520
  "STATUS_5_delay of 5 months",
521
+ 0.04029083926098087
522
  ],
523
  [
524
  "STATUS_0_delay of 8 months",
525
+ -0.03989328482470391
526
  ],
527
  [
528
  "PAID_4_paid nothing",
529
+ 0.030239839152150578
530
  ],
531
  [
532
  "PAID_2_no balance",
533
+ 0.029314204273452448
534
  ],
535
  [
536
  "STATUS_0_delay of 7 months",
537
+ 0.027682360024328365
538
  ],
539
  [
540
  "BILL_AMT5",
541
+ 0.02610742724500418
542
  ],
543
  [
544
  "STATUS_2_delay of 2 months",
545
+ 0.025343683133782442
546
  ],
547
  [
548
  "STATUS_6_delay of 7 months",
549
+ -0.025146023500980816
550
  ],
551
  [
552
  "STATUS_4_no delinquency recorded, code undefined",
553
+ -0.02296436281798626
554
  ],
555
  [
556
  "PAID_1_paid in full",
557
+ 0.022724009839817483
558
  ],
559
  [
560
  "PAID_4_paid in full",
561
+ 0.02245439367494789
562
  ],
563
  [
564
  "STATUS_3_no delinquency recorded, code undefined",
565
+ -0.021565816950964413
566
  ],
567
  [
568
  "STATUS_4_paid duly",
569
+ 0.020762235068190773
570
  ],
571
  [
572
  "STATUS_6_delay of 4 months",
573
+ 0.019296387292338728
574
  ],
575
  [
576
  "STATUS_4_delay of 3 months",
577
+ -0.019237043787947525
578
  ],
579
  [
580
  "STATUS_2_delay of 1 month",
581
+ -0.01721996140750323
582
  ],
583
  [
584
  "STATUS_5_delay of 4 months",
585
+ -0.016779851753297246
586
  ],
587
  [
588
  "STATUS_3_delay of 3 months",
589
+ 0.016488680440516868
590
  ],
591
  [
592
  "STATUS_2_delay of 5 months",
593
+ 0.014957419929230715
594
  ],
595
  [
596
  "PAY_RATIO_RECENT",
597
+ -0.014744579451479636
598
  ],
599
  [
600
  "STATUS_6_delay of 6 months",
601
+ 0.013758271323696863
602
  ],
603
  [
604
  "PAID_3_no balance",
605
+ -0.013308180673404297
606
  ],
607
  [
608
  "PAY_AMT4",
609
+ -0.011886073604529012
610
  ],
611
  [
612
  "STATUS_3_delay of 4 months",
613
+ -0.011652950713743126
614
  ],
615
  [
616
  "PAID_3_paid part",
617
+ 0.011198663075826232
618
  ],
619
  [
620
  "STATUS_3_delay of 5 months",
621
+ -0.010570088837797562
622
  ],
623
  [
624
  "PAY_AMT6",
625
+ -0.010199223770709179
626
  ],
627
  [
628
  "PAY_AMT5",
629
+ -0.010192317105689951
630
  ],
631
  [
632
  "STATUS_5_delay of 3 months",
633
+ -0.008719319679223644
634
  ],
635
  [
636
  "STATUS_2_delay of 6 months",
637
+ -0.0066645897593760675
638
  ],
639
  [
640
  "PAY_AMT3",
641
+ -0.005409485111934878
642
  ],
643
  [
644
  "STATUS_2_delay of 3 months",
645
+ 0.0053150067807837854
646
  ],
647
  [
648
  "STATUS_4_delay of 8 months",
649
+ 0.005105130451058765
650
  ],
651
  [
652
  "STATUS_5_delay of 8 months",
653
+ 0.005105130451058765
654
  ],
655
  [
656
  "STATUS_6_delay of 8 months",
657
+ 0.005105130451058765
658
  ],
659
  [
660
  "STATUS_4_delay of 4 months",
661
+ -0.003551067523748044
662
  ],
663
  [
664
  "PAID_5_no balance",
665
+ 0.003222446885544461
666
  ],
667
  [
668
  "STATUS_0_delay of 5 months",
669
+ 0.003219742087970856
670
  ],
671
  [
672
  "STATUS_6_delay of 5 months",
673
+ 0.002269724948883509
674
  ],
675
  [
676
  "STATUS_5_no delinquency recorded, code undefined",
677
+ 0.002162756013280376
678
  ],
679
  [
680
  "STATUS_3_delay of 7 months",
681
+ -0.0006486499754519148
682
  ],
683
  [
684
  "PAID_2_paid in full",
685
+ -0.00031853069544259726
686
  ],
687
  [
688
  "STATUS_0_delay of 6 months",
689
+ -0.0003018817489643535
690
  ],
691
  [
692
  "STATUS_3_delay of 8 months",
693
+ -0.0001632838231806132
694
  ]
695
  ],
696
+ "intercept": -0.2309387424099975,
697
  "data_url": "https://huggingface.co/datasets/drdavidprivacy/practicum-case-packs/resolve/main/corvana_modeling_extract_remediated.csv",
698
  "dataset_repo": "https://huggingface.co/datasets/drdavidprivacy/practicum-case-packs",
699
  "versions": {