RubyIntelligence commited on
Commit
fc32682
·
verified ·
1 Parent(s): 04ec683

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +150 -0
README.md ADDED
@@ -0,0 +1,150 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # FDA Warning Letter Escalation Dataset
2
+ **Version:** 1.0.0 | **Records:** 14,810 | **Price:** $2,000 | **Source:** FDA (public domain)
3
+
4
+ ## Dataset Summary
5
+ **The dataset's core signal — whether an inspection escalated to a Warning Letter — is validated against FDA's own severity classifications: OAI inspections escalate at 64% versus 1.7% for NAI, a 39× relationship that confirms the data reflects real regulatory behavior.**
6
+
7
+ The 14,810 inspections that escalated to enforcement — every inspection followed by a Warning Letter, Injunction, or Seizure — with full citation context and exact timing (days from inspection to action, and 90/180/365-day windows). Pure signal: the dataset of what FDA findings actually precede enforcement. Built for RA/QA risk modelling and enforcement-pattern analysis.
8
+
9
+ Current through 2026 — the dataset includes FDA inspections from the most recent regulatory cycles
10
+ (covering 5,713 facilities inspected in 2026 and 14,845 in 2025), not a historical snapshot.
11
+ Quarterly refreshes keep it current.
12
+
13
+ ## What This Replaces
14
+ Comparable facility-level FDA regulatory intelligence from incumbent enterprise
15
+ platforms requires annual contracts and enterprise procurement. This dataset
16
+ delivers the same enforcement-escalation intelligence as a one-time,
17
+ analysis-ready download — no contract, no seat licenses, no platform lock-in.
18
+
19
+ ## Source
20
+ All data derives from U.S. FDA public records:
21
+ - **FDA Data Dashboard API** — inspections, inspection citations, inspection classifications,
22
+ compliance actions (Warning Letters / Injunctions / Seizures), and import refusals.
23
+ - **openFDA** — 510(k) device clearances, establishment registrations, device & drug recall
24
+ enforcement reports, and device classification.
25
+ - All sources are U.S. Government works in the **public domain (CC0)**. No PII is included
26
+ (no patient, reporter, or individual-inspector identities).
27
+
28
+ ## The Premium Fields
29
+ The premium fields are the **escalation linkage** — computed by matching each inspection to the
30
+ nearest subsequent enforcement action at the same facility:
31
+
32
+ - **`days_inspection_to_warning_letter`** — exact day gap from the inspection's end to the nearest
33
+ subsequent Warning Letter / Injunction / Seizure. Always positive (directionality enforced);
34
+ null if no action followed. The raw day count is provided so you can set your own thresholds.
35
+ - **`escalated_within_90d` / `_180d` / `_365d` / `escalated_ever`** — convenience booleans derived
36
+ from the day gap.
37
+ - **`escalated_warning_letter_action_type`** — which action followed (Warning Letter, Injunction, or
38
+ Seizure), so you can restrict to Warning-Letter-only escalation if you wish.
39
+ - **`citation_count` / `cfr_codes_cited` / `citation_descriptions`** — the inspection's full citation
40
+ context, so the finding and its consequence sit in one row.
41
+
42
+ ## Methodology
43
+ - **Entity resolution.** Records are joined on the FDA **FEINumber** (Facility Establishment
44
+ Identifier), normalized to a trimmed string across every source. 510(k) clearances and import
45
+ refusals carry an FEI directly.
46
+ - **Escalation matching.** For each inspection, the dataset finds compliance actions at the *same
47
+ FEI* whose action date is **strictly after** the inspection end date, and keeps the **nearest**
48
+ one (smallest positive day gap). Directionality is enforced in the join itself, so a Warning
49
+ Letter that predates an inspection can never be counted as escalation. Escalation actions are
50
+ Warning Letters (the canonical case) plus the stronger judicial actions Injunction and Seizure;
51
+ the action type is retained so you can restrict to Warning-Letter-only.
52
+ - **Risk score.** Computed from each facility's history with a published formula:
53
+
54
+ ```
55
+ facility_risk_score = min(100,
56
+ oai_count × 15
57
+ + warning_letter_count × 20
58
+ + recall_count × 10
59
+ + min(import_refusal_count × 2, 20) (import-refusal contribution capped at 20)
60
+ + (repeat_citation_flag ? 10 : 0)
61
+ + (most_recent_classification == OAI ? 15 : 0)
62
+ + recency_factor)
63
+
64
+ recency_factor (awarded only when the most recent inspection outcome was OAI or VAI):
65
+ +10 if that inspection was within 1 year, +5 if within 3 years, +2 if within 5 years
66
+ (evaluated as of the 2026-06-23 build date)
67
+ ```
68
+
69
+ - **Recall attribution.** Recall enforcement reports carry no FEI, so recalls are matched to
70
+ facilities by **normalized firm name** (uppercased, punctuation and common legal suffixes
71
+ removed). The match is deliberately restricted to **unambiguous 1:1 names** — a normalized name
72
+ owned by exactly one facility — to prevent a multi-site chain's recalls from being falsely
73
+ attributed to every location that shares its name.
74
+
75
+ ## Validation
76
+ - **Escalation signal validated.** OAI (Official Action Indicated) inspections escalate to Warning
77
+ Letters at **64%** versus **1.7%** for NAI (No Action Indicated) inspections — a monotone,
78
+ ~39× relationship confirming the computed escalation fields correlate correctly with inspection
79
+ severity. (If escalation were a join artifact, NAI and OAI would escalate at similar rates.)
80
+ - **Directionality enforced.** Zero inspections have a negative inspection→action day gap; every
81
+ Warning Letter counted as escalation post-dates its inspection.
82
+ - **No orphaned escalations.** Every recorded escalation action type exists in the source
83
+ compliance-action data.
84
+ - **Recall attribution restricted** to unambiguous 1:1 facility-name matches to prevent false
85
+ attribution (see Methodology).
86
+ - **Completeness.** Row counts reconcile exactly to the validated master tables.
87
+
88
+ ## Known Limitations
89
+ - **Citation coverage.** Inspection citations cover electronically generated, finalized
90
+ inspections; some manually prepared Form 483s are not present in the FDA citations dataset.
91
+ - **Recall attribution (~35%).** Only recalls with an unambiguous 1:1 firm-name match are
92
+ attributed; multi-site chains that share a normalized name are deliberately excluded to avoid
93
+ false attribution, so recall counts are conservative (under- rather than over-counted).
94
+ - **Inspector-level detail not included.** The FDA citations API does not expose individual
95
+ inspector identity, so inspector-level fields are out of scope for this version.
96
+ - **Risk score is a heuristic.** `facility_risk_score` is a transparent composite indicator, **not**
97
+ an official FDA designation or prediction. All underlying counts are included so you can recompute
98
+ it with your own weights.
99
+ - **Warning Letter coverage.** Warning Letters are attributed to facilities that appear in the
100
+ inspection record; Warning Letters issued to firms without an inspection in the dataset are not
101
+ rolled into a facility row.
102
+ - **Escalation timing always populated here.** Because this dataset is filtered to inspections that
103
+ escalated, `days_inspection_to_warning_letter` and `escalated_warning_letter_action_type` are
104
+ populated on every row. In the full inspection dataset these fields are null by design for the
105
+ large majority of inspections that never escalate, reflecting that most FDA inspections do not
106
+ lead to enforcement.
107
+ - **Null-by-design citation context.** The citation fields (`citation_count`, `cfr_codes_cited`,
108
+ `citation_descriptions`) can be empty/null for escalated inspections with no posted citations on
109
+ record. This is accurate — some inspections result in enforcement without posted 483 citations,
110
+ and many inspections classified NAI carry no citations at all. The `posted_citations` flag is
111
+ included so this is transparent.
112
+
113
+ ## Field Definitions
114
+ | Field | Type | Description |
115
+ |-------|------|-------------|
116
+ | `fei_number` | string | FDA Facility Establishment Identifier (FEI) of the inspected facility. |
117
+ | `inspection_id` | string | FDA Data Dashboard inspection identifier (not unique per row — an inspection may span multiple product/program rows). |
118
+ | `legal_name` | string | Inspected facility legal name. |
119
+ | `inspection_end_date` | date | Date the inspection ended. |
120
+ | `fiscal_year` | string | FDA fiscal year of the inspection. |
121
+ | `classification` | string | Inspection outcome classification (full text). |
122
+ | `classification_code` | string | Inspection outcome code: NAI (No Action), VAI (Voluntary Action), OAI (Official Action). |
123
+ | `project_area` | string | FDA project area for the inspection. |
124
+ | `product_type` | string | Product area covered by this inspection row (Drugs, Devices, Foods, etc.). |
125
+ | `posted_citations` | string | FDA flag indicating whether citations were posted for this inspection. |
126
+ | `city` | string | Facility city. |
127
+ | `state` | string | Facility state/province. |
128
+ | `state_code` | string | Facility state code. |
129
+ | `country` | string | Facility country. |
130
+ | `firm_profile` | string | URL to the facility's FDA FirmProfile page. |
131
+ | `citation_count` | integer | Number of citations (483 observations) recorded for this inspection. |
132
+ | `cfr_codes_cited` | list<string> | Distinct CFR codes cited in this inspection. |
133
+ | `citation_descriptions` | list<string> | Short descriptions of the citations issued in this inspection. |
134
+ | `days_inspection_to_warning_letter` | integer | Days from this inspection's end to the NEAREST subsequent escalation action at the same facility (Warning Letter / Injunction / Seizure). Populated on every row in this escalation-filtered dataset (null by design only in the full inspection dataset, when no escalation followed). Always positive — directionality is enforced (the action must post-date the inspection). |
135
+ | `escalated_warning_letter_action_type` | string | ActionType of the nearest subsequent escalation (Warning Letter, Injunction, or Seizure); populated on every row in this escalation-filtered dataset. |
136
+ | `escalated_within_90d` | boolean | True if an escalation action followed within 90 days of the inspection. |
137
+ | `escalated_within_180d` | boolean | True if an escalation action followed within 180 days. |
138
+ | `escalated_within_365d` | boolean | True if an escalation action followed within 365 days. |
139
+ | `escalated_ever` | boolean | True if an escalation action followed at any time after the inspection. |
140
+
141
+ ## Update Cadence
142
+ Quarterly, tracking FDA Data Dashboard refreshes.
143
+
144
+ ## License
145
+ Derived entirely from U.S. federal government public records (FDA Data Dashboard, openFDA), which
146
+ are in the public domain. This structured, enriched version is provided under **CC BY 4.0** —
147
+ attribution required.
148
+
149
+ ## How to Access the Full Dataset
150
+ Full dataset available at [Ruby Intelligence on Gumroad](https://rubyintelligence.gumroad.com/l/vvafiy).