RubyIntelligence commited on
Commit
aed90db
·
verified ·
1 Parent(s): 6a93dd8

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +148 -0
README.md ADDED
@@ -0,0 +1,148 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # FDA Inspection & Escalation Dataset
2
+ **Version:** 1.0.0 | **Records:** 271,609 | **Price:** $2,500 | **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
+ Every FDA inspection on record — 271,609 inspections — enriched with citation detail, outcome classification, and the premium escalation fields that link each inspection to the Warning Letter (or stronger action) that followed it, with exact timing. Built for RA/QA teams benchmarking inspection outcomes, consultants modelling enforcement risk, and analysts studying what inspection findings actually lead to enforcement.
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 inspection-level escalation analytics 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
+ - **Null-by-design escalation timing.** The `days_inspection_to_warning_letter` and
103
+ `escalated_warning_letter_action_type` fields are null by design for inspections not followed by a
104
+ Warning Letter or stronger action (`escalated_ever` = false) — the large majority of inspections,
105
+ reflecting that most FDA inspections do not lead to enforcement.
106
+ - **Null-by-design citation context.** The citation fields (`citation_count`, `cfr_codes_cited`,
107
+ `citation_descriptions`) are empty/null for inspections with no posted citations on record. This
108
+ is accurate — many inspections, particularly those classified NAI, result in no citations. The
109
+ `posted_citations` flag is included so this is transparent.
110
+
111
+ ## Field Definitions
112
+ | Field | Type | Description |
113
+ |-------|------|-------------|
114
+ | `fei_number` | string | FDA Facility Establishment Identifier (FEI) of the inspected facility. |
115
+ | `inspection_id` | string | FDA Data Dashboard inspection identifier (not unique per row — an inspection may span multiple product/program rows). |
116
+ | `legal_name` | string | Inspected facility legal name. |
117
+ | `inspection_end_date` | date | Date the inspection ended. |
118
+ | `fiscal_year` | string | FDA fiscal year of the inspection. |
119
+ | `classification` | string | Inspection outcome classification (full text). |
120
+ | `classification_code` | string | Inspection outcome code: NAI (No Action), VAI (Voluntary Action), OAI (Official Action). |
121
+ | `project_area` | string | FDA project area for the inspection. |
122
+ | `product_type` | string | Product area covered by this inspection row (Drugs, Devices, Foods, etc.). |
123
+ | `posted_citations` | string | FDA flag indicating whether citations were posted for this inspection. |
124
+ | `city` | string | Facility city. |
125
+ | `state` | string | Facility state/province. |
126
+ | `state_code` | string | Facility state code. |
127
+ | `country` | string | Facility country. |
128
+ | `firm_profile` | string | URL to the facility's FDA FirmProfile page. |
129
+ | `citation_count` | integer | Number of citations (483 observations) recorded for this inspection. |
130
+ | `cfr_codes_cited` | list<string> | Distinct CFR codes cited in this inspection. |
131
+ | `citation_descriptions` | list<string> | Short descriptions of the citations issued in this inspection. |
132
+ | `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). Null by design when no escalation followed (the large majority of inspections). Always positive — directionality is enforced (the action must post-date the inspection). |
133
+ | `escalated_warning_letter_action_type` | string | ActionType of the nearest subsequent escalation (Warning Letter, Injunction, or Seizure); null by design when no escalation followed. |
134
+ | `escalated_within_90d` | boolean | True if an escalation action followed within 90 days of the inspection. |
135
+ | `escalated_within_180d` | boolean | True if an escalation action followed within 180 days. |
136
+ | `escalated_within_365d` | boolean | True if an escalation action followed within 365 days. |
137
+ | `escalated_ever` | boolean | True if an escalation action followed at any time after the inspection. |
138
+
139
+ ## Update Cadence
140
+ Quarterly, tracking FDA Data Dashboard refreshes.
141
+
142
+ ## License
143
+ Derived entirely from U.S. federal government public records (FDA Data Dashboard, openFDA), which
144
+ are in the public domain. This structured, enriched version is provided under **CC BY 4.0** —
145
+ attribution required.
146
+
147
+ ## How to Access the Full Dataset
148
+ Full dataset available at [Ruby Intelligence on Gumroad](https://rubyintelligence.gumroad.com/l/dddwos).