File size: 10,213 Bytes
9d4e239
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
---
license: cc-by-4.0
language:
- en
pretty_name: OpenFundex
tags:
- finance
- value-investing
- sec-filings
- fundamental-analysis
- tabular
task_categories:
- tabular-classification
- tabular-regression
size_categories:
- 100K<n<1M
configs:
  - config_name: default
    default: true
    data_files:
      - { split: train,      path: train_clean.parquet }
      - { split: validation, path: validation_clean.parquet }
      - { split: test,       path: test_clean.parquet }
  - config_name: full
    data_files:
      - { split: train,      path: train.parquet }
      - { split: validation, path: validation.parquet }
      - { split: test,       path: test.parquet }
  - config_name: live
    data_files:
      - { split: clean, path: recent_clean.parquet }
      - { split: full,  path: recent.parquet }

---

# OpenFundex Dataset

A structured dataset of SEC financial filings for deep value analysis and financial distress prediction.

## Dataset Description

- **License**: CC-BY-4.0
- **Language**: English

### Summary

OpenFundex contains financial statement data extracted from SEC EDGAR filings,
enriched with derived financial metrics and labeled with established quality scores
(Piotroski F-Score, Altman Z'-Score, Graham metrics). Designed for training ML
models to assess company financial health and identify deep value opportunities.

**Key design decision:** This dataset uses only fundamental data from SEC filings.
No market prices or equity trading data are included, eliminating survivorship bias.

## Supported Tasks

- **Tabular Classification**: Predict financial distress, bankruptcy, value creation, fundamental improvement
- **Tabular Regression**: Predict quality scores (f_score, z_prime_score, composite_quality_score), growth rates
- **Anomaly Detection**: Identify companies in financial distress or with QA anomalies

## Dataset Structure

### Splits

| Split | Records | Companies | Date Range |
|-------|---------|-----------|------------|
| train | 221,779 | 11,786 | 2008-12-31 to 2019-12-31 |
| validation | 45,109 | 7,207 | 2020-01-31 to 2021-12-31 |
| test | 47,334 | 7,208 | 2022-01-31 to 2023-12-31 |
| recent | 43,288 | 6,507 | 2024-01-31 to 2026-02-28 |

**Total records:** 357,510

### Feature Groups

| Group | Count |
|-------|-------|
| Identifiers | 5 |
| Context | 4 |
| Raw Features (SEC XBRL) | 33 |
| Derived Features | 8 |
| Engineered Features | 23 |
| QA Flags | 4 |
| Prediction Targets | 21 |
| Rank Targets | 14 |

## Scoring Models

- **Piotroski F-Score** (0-9): Nine binary signals measuring profitability, leverage, and operating efficiency. Null when no prior quarter available for delta signals.
- **Altman Z'-Score** (Float): Private-firm bankruptcy risk variant with zone classification (safe/grey/distress). Null for financial firms (SIC 6000-6999).
- **Beneish Coverage** (0-8): Count of computable M-Score components. Full M-Score is computed transiently during enrichment but not retained.
- **Graham Metrics**: Graham Number, NCAV/share, tangible book value/share, net working capital/share, defensive score (0-5).
- **Quality Signals**: Cash conversion ratio, accrual ratio, free cash flow margin.
- **Composite Quality Score**: Z-score normalized average of key quality signals within each quarter cross-section.

## Target Columns

21 forward-looking prediction targets using same-quarter year-over-year comparisons:

### 1-Year Targets
- **Growth rates** (6): BVPS, equity, earnings, revenue, OCF, FCF growth
- **Level/delta** (2): Forward ROE, margin expansion
- **Binary** (5): ROA improved, fundamentals improved (≥3 of 5 metrics), value created (equity grew AND ROE>0), survived (filed Q+4 AND no bankruptcy in window; NULL when CIK is in dropout-cause cohort with cause ∈ {form_25_delisting, unexplained_dark} and the PIT gate is met — see Considerations), filed for bankruptcy (petition within 365 days)

### 2-Year Targets
- **Growth rates** (6): Same metrics as 1-year, over 2-year horizon
- **Binary** (2): Survived (filed Q+8 AND no bankruptcy in window; NULL when CIK is in dropout-cause cohort with cause ∈ {form_25_delisting, unexplained_dark} and the PIT gate is met — see Considerations), filed for bankruptcy (petition within 730 days)

Survived and bankruptcy targets are mutually exclusive by construction. All targets are null when forward quarter data is unavailable.
A third NULL state (CP-1 / v0.7.0) excludes Form-25 (M&A proxy) and unexplained-dark dropouts from the negative class to avoid mislabeling acquired companies as failed survivors.

### Rank-Transformed Targets (14 columns)

Cross-sectional percentile ranks (0-1] for all Float64 targets, computed per quarter
using `rank("average") / count()`. Raw growth targets are extremely skewed
(mean ~3.1, median ~0.03) and produce negative information coefficients for
regression models. Rank-transforming yields IC ~0.37.

## Dataset Creation

### Source Data

All data sourced from SEC EDGAR: Financial Statement Data Sets (FSDS) for fundamentals
and Full-Text Search API (EFTS) for 8-K Item 1.03 bankruptcy filings.
No market data providers. No third-party data. No equity pricing data.

### Pipeline

1. **Ingest**: Download quarterly SEC FSDS ZIP files and bankruptcy events from EDGAR
2. **Parse**: Extract XBRL financial data, normalize 32 tags to standard fields
3. **Enrich**: Compute derived ratios (8), scoring models (5), bankruptcy flags, and QA flags
4. **Label**: Generate 21 forward-looking prediction targets (including bankruptcy)
5. **Split**: Temporal train/validation/test/recent splits with leakage validation
6. **Evaluate**: Quality checks, ML fitness, and publication readiness
7. **Publish**: Stage and upload to Hugging Face Hub

## Considerations

### Known Limitations

- XBRL coverage varies: some companies report fewer standardized tags
- F-Score delta components require prior quarter data (null for first appearance)
- Z'-Score was designed for manufacturing firms; interpretation varies by sector
- No market data: cannot compute price-based metrics (P/E, market cap, etc.)
- `bankruptcy_chapter` is populated for bankrupt CIKs (values like `"7"`, `"11"`,
  `"15"`, `"9"` extracted via 8-K Item 1.03 filing bodies); non-bankrupt rows
  are null. Edge cases not yet handled: chapter spelled out as a word
  ("chapter eleven") and USC-only citations with no "chapter" keyword both
  yield null.

### Bias Considerations

- **Survivorship bias** (Audit C1 / C1.1, 2026-05-05/06): the panel is built from
  SEC FSDS XBRL filings, so companies that stopped filing leave the panel
  silently. An audit of the 2009Q2–2026Q1 window classified 8,847 stopped-filing
  CIKs by cause: 54.4% Form-15 deregistration, 33.3% unexplained-dark,
  8.7% bankruptcy, 3.6% Form-25 delisting (M&A proxy). LoPucki BRD intersect
  analysis (Audit C1.1) shows 21.4% of in-window Chapter 7/11 bankruptcies
  (83/388) are entirely absent from the panel, concentrated 2009–2011 during
  the XBRL ramp-up — a structural lower bound on missed bankruptcies.
- **Survival target NULL semantics** (CP-1 / v0.7.0): `target_survived_1y` and
  `target_survived_2y` are set to NULL on rows where the CIK appears in the
  bundled dropout-cause cohort with cause ∈ {`form_25_delisting`,
  `unexplained_dark`} and the PIT gate is met (Form-25 `evidence_date` falls
  inside the label horizon, or `unexplained_dark` always-NULL). This avoids
  mislabeling acquired companies (Form-25 = M&A proxy) and unexplained
  dropouts as failed survivors. Bankruptcy and Form-15 CIKs remain in the
  negative class. The cohort artifact is shipped with the package at
  `openfundex/cohorts/_data/dropout_causes.parquet` and regenerable via
  `ofx cohorts refresh dropout-causes`.
- **Temporal integrity**: Strict time-based splits prevent data leakage
- **Sector bias**: Z'-Score thresholds may not be equally applicable across all sectors
- **Financial firms excluded from Z'-Score**: Financial companies (SIC 6000-6999) have null Z'-Score values

## License

This dataset is released under the [CC-BY-4.0 license](https://creativecommons.org/licenses/by/4.0/).

The underlying SEC data is in the public domain.

## Citation

```bibtex
@dataset{openfundex,
  title={OpenFundex: SEC Financial Filings for Deep Value Analysis},
  author={Danielson, Luke},
  year={2026},
  url={https://github.com/danielukea/openfundex},
  license={CC-BY-4.0}
}
```

## Changelog

### v0.7.0 — 2026-05-14
- **`target_survived_{1y,2y}` NULL semantics widened (CP-1):** rows where the CIK
  appears in the bundled dropout-cause cohort with cause ∈ {`form_25_delisting`,
  `unexplained_dark`} and the PIT gate is met are now NULL instead of False.
  This excludes M&A proxies and unknown-cause dropouts from the survival
  negative class to avoid mislabeling acquired companies. Bankruptcy and
  Form-15 CIKs remain negatives. Schema unchanged; this is a value-contract
  change. See Considerations § Survivorship bias.
- New bundled package data: `src/openfundex/cohorts/_data/dropout_causes.parquet`
  (8,847 CIKs classified by precedence). Regenerable via `ofx cohorts refresh
  dropout-causes`.

### v0.6.0 — 2026-04-17
- **`bankruptcy_chapter` populated:** Chapter number (`"7"`, `"11"`, `"15"`, `"9"`)
  is now extracted from the 8-K Item 1.03 filing body for each bankrupt CIK and
  stored in the `bankruptcy_chapter` column. Non-bankrupt rows remain null.
  Extraction uses a guardword-gated Item 1.03 window search; known limitations
  (word-spelled chapters, USC-only citations) are documented above.

### v0.5.0 — 2026-04-17
- **Loader contract:** dataset card now declares explicit `configs` and `data_files`. `load_dataset("ttchopper/openfundex")` returns the QA-filtered historical splits (`train`/`validation`/`test`); unfiltered historical data is available via `load_dataset(..., "full")`; live 2024+ inference data via `load_dataset(..., "live")`.
- Previously the card omitted `configs:`, causing the Hub to glob all parquets and misassemble splits (paired `_clean` files were concatenated or surfaced as extra splits, and `recent*` was not declared at all).
- Raw parquet access (`hf://datasets/ttchopper/openfundex/train.parquet`) is unaffected.