elsiddik commited on
Commit
98e35f9
·
verified ·
1 Parent(s): e038e0c

Update Plan B dataset (2026-11-13)

Browse files
Files changed (3) hide show
  1. README.md +61 -44
  2. daily_rankings.csv +0 -0
  3. daily_rankings.jsonl +0 -0
README.md CHANGED
@@ -54,9 +54,7 @@ configs:
54
 
55
  # Plan B — Contrarian Deep-Value US Equities & AI 10-K Analysis
56
 
57
- **Plan B** is a daily quantitative and fundamental research dataset covering deeply discounted, financially resilient, and heavily beaten-down US operating companies across the **NYSE** and **Nasdaq**.
58
-
59
- Every trading day, Plan B screens the entire US equity universe (~6,000 SEC XBRL filers) using primary **SEC EDGAR XBRL frames**, **3-year weekly price series**, **SEC Form 4 open-market insider transactions**, **FINRA short interest & short volume** (via Massive), **news sentiment**, and **LLM-synthesized 10-K/20-F deep-value investment memos**.
60
 
61
  ---
62
 
@@ -65,8 +63,8 @@ Every trading day, Plan B screens the entire US equity universe (~6,000 SEC XBRL
65
  | Metric | Value |
66
  | :--- | :--- |
67
  | **Coverage Window** | `2026-11-02` → `2026-11-13` (12 daily scans) |
68
- | **Unique Shortlisted Companies** | 66 NYSE/Nasdaq tickers |
69
- | **Daily Ranking Observations** | 427 rows (129 features per row) |
70
  | **Structured AI 10-K/20-F Memos** | 21 filings analyzed |
71
  | **Open-Market Form 4 Insider Trades** | 376 verified transactions |
72
  | **Update Frequency** | Daily (automated post-market scan) |
@@ -85,55 +83,41 @@ Every trading day, Plan B screens the entire US equity universe (~6,000 SEC XBRL
85
 
86
  ---
87
 
88
- ## 📁 Dataset Structure & Files
89
 
90
- Each table is provided in both **CSV** (ideal for Kaggle, Pandas, R, and DuckDB) and **JSON Lines (`.jsonl`)** (ideal for Hugging Face `datasets`, Spark, and LLM pipelines).
91
 
92
  | Table / Config | Files | Primary Key | Description |
93
  | :--- | :--- | :--- | :--- |
94
- | **`daily_rankings`** *(default)* | `daily_rankings.csv`<br>`daily_rankings.jsonl` | `(date, ticker)` | Daily ranked contrarian shortlist (~40 companies/day) with composite scores, valuation ratios, SEC XBRL balance-sheet & cash-flow fundamentals, insider totals, and AI 10-K verdict summary. |
95
- | **`ai_10k_memos`** | `ai_10k_memos.csv`<br>`ai_10k_memos.jsonl` | `(ticker, accession)` | Skeptical value-investor memos generated from Item 1 (Business), Item 1A (Risk Factors), and Item 7 (MD&A) of each company's latest SEC Form 10-K or 20-F. |
96
- | **`insider_trades`** | `insider_trades.csv`<br>`insider_trades.jsonl` | `(ticker, owner, kind, date, shares, form4_url)` | Open-market insider purchases (`P`) and sales (`S`) parsed directly from SEC Form 4 XML filings over the trailing 180 days (excluding option grants/awards). |
97
- | **`scan_stats`** | `scan_stats.csv`<br>`scan_stats.jsonl` | `date` | Daily universe screening funnel: total filers, usable XBRL fundamentals, priced equities, and shortlisted count. |
98
 
99
  ---
100
 
101
- ## 🎯 Screening & Ranking Methodology
102
-
103
- Plan B follows a strict Graham–Klarman–Buffett deep-value discipline. Financial institutions (SIC 6000–6799: banks, insurers, REITs, SPACs) are excluded so balance-sheet ratios remain comparable across operating businesses.
104
-
105
- ### 1. Hard Quantitative Screen (`Cheap + Safe + Hated`)
106
- A company must pass **all three** pillars simultaneously:
107
- - **Cheap:** P/E ≤ 12, **or** EV/EBIT ≤ 8, **or** trading below Net Current Asset Value (`NCAV / Market Cap ≥ 1.0`, a classic Benjamin Graham net-net).
108
- - **Safe:** Positive stockholders' equity, current ratio ≥ 1.2, total liabilities ≤ 2.0× equity (or net cash position), 3-year share dilution ≤ 25%, and positive operating cash flow if net income is negative.
109
- - **Hated:** Share price down at least **40%** from its 3-year weekly high (`dd_3y ≤ -0.40`), with market cap ≥ $50M and share price ≥ $1.00.
110
 
111
- ### 2. Composite Score (`0–100`)
112
- - **Base Weighting:** 40% **Cheap** (`cheap_score`) + 30% **Safe** (`safe_score`) + 30% **Hated** (`hated_score`, blending price drawdown and headline negativity `news_neg`).
113
- - **Bonuses:** Net open-market Form 4 insider buying (up to +12 pts) and 3-year share count reduction via buybacks (+4 pts).
114
- - **Penalties:** Share dilution, negative free cash flow, accrual divergence (net income significantly exceeding operating cash flow or operating income), one-off profits following consecutive loss years, and high goodwill/M&A intensity.
115
- - **AI 10-K Adjustment:** After reading the 10-K filing, the composite score is adjusted by the AI analyst's verdict (`CONTRARIAN BUY CANDIDATE`, `WATCH`, or `AVOID`) and conviction (`0–100`).
116
-
117
- ---
118
 
119
- ## 🚀 Quickstart Usage
120
-
121
- ### Python (`datasets` — Hugging Face)
122
  ```python
123
  from datasets import load_dataset
124
 
125
  # Load default config (daily_rankings)
126
- rankings = load_dataset("elsiddik/planb-deep-value", "daily_rankings", split="train")
127
- print(rankings.to_pandas()[["date", "rank", "ticker", "score", "pe", "ev_ebit", "dd_3y", "ai_verdict"]].head())
128
-
129
- # Load structured 10-K AI memos
130
- memos = load_dataset("elsiddik/planb-deep-value", "ai_10k_memos", split="train")
131
 
132
- # Load Form 4 open-market insider trades
133
- insiders = load_dataset("elsiddik/planb-deep-value", "insider_trades", split="train")
 
134
  ```
135
 
136
- ### Python (`pandas` — Kaggle / Local CSV)
 
 
 
 
137
  ```python
138
  import pandas as pd
139
 
@@ -141,16 +125,41 @@ df = pd.read_csv("daily_rankings.csv")
141
  memos = pd.read_csv("ai_10k_memos.csv")
142
  insiders = pd.read_csv("insider_trades.csv")
143
 
144
- # Filter highest-conviction ideas with net cash and insider buying
145
- top_ideas = df[(df["net_cash"] > 0) & (df["insider_buy_value"] > 0)].sort_values(["date", "rank"])
146
  print(top_ideas[["date", "ticker", "name", "score", "pe", "ev_ebit", "net_cash_pct", "ai_verdict"]].head(10))
147
  ```
148
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
149
  ---
150
 
151
  ## 📖 Data Dictionary
152
 
153
- ### 1. `daily_rankings` (${RANKING_COLS.length} Columns)
 
154
 
155
  | Column | Type | Description |
156
  | :--- | :--- | :--- |
@@ -180,13 +189,16 @@ print(top_ideas[["date", "ticker", "name", "score", "pe", "ev_ebit", "net_cash_p
180
  | `pri_period`, `pri_assets`, `pri_liab`, `pri_ca`, `pri_cl`, `pri_ar`, `pri_ppe`, `pri_shares` | `mixed` | Balance-sheet values from the same SEC instant one year earlier, used for year-over-year quality tests. |
181
  | `short_pct_float`, `short_ratio`, `short_chg_mom` | `float` | Short interest as % of float, days-to-cover ratio, and change vs the prior report (biweekly FINRA settlement when `short_src`=`finra`, else Yahoo month-over-month). |
182
  | `held_pct_insiders`, `held_pct_institutions` | `float` | Share of the company held by insiders and by institutions. |
183
- | `short_src`, `short_vol_avg`, `short_vol_last`, `float_shares` | `string`/`float`/`int` | Short-interest source (`finra` = Massive/FINRA settlement), average and latest daily off-exchange short-volume ratio (0–1, FINRA via Massive), and Massive free-float share count. |
184
  | `insider_buyers_sameday`, `insider_unplanned_buy_value` | `int`/`float` | Max distinct insiders buying on one day (Massive Form 4/5 aggregation) and insider purchase USD excluding 10b5-1 pre-planned trades. |
185
  | `activist_form`, `activist_date`, `activist_name`, `activist_pct` | `mixed` | Latest Schedule 13D/13G stake filed against the company (form, date, reporting person, % of class). |
186
  | `tenk_date`, `tenk_accession`, `tenk_form`, `tenk_url` | `string` | Filing date, SEC accession number, form type (`10-K` / `20-F`), and direct SEC EDGAR archive URL. |
187
  | `ai_verdict`, `ai_conviction`, `ai_balance_sheet`, `ai_value_trap_risk`, `ai_one_liner` | `mixed` | AI 10-K analyst summary fields (`CONTRARIAN BUY CANDIDATE` / `WATCH` / `AVOID`, conviction `0–100`, balance sheet rating, value-trap risk, and one-line thesis). |
188
 
189
- ### 2. `ai_10k_memos` (21 Columns)
 
 
 
190
 
191
  | Column | Type | Description |
192
  | :--- | :--- | :--- |
@@ -196,7 +208,10 @@ print(top_ideas[["date", "ticker", "name", "score", "pe", "ev_ebit", "net_cash_p
196
  | `one_liner`, `business`, `why_hated`, `capital_allocation`, `management` | `string` | Concise investment synthesis covering the business model, market pessimism, buybacks/dividends/M&A, and leadership. |
197
  | `bull`, `bear`, `red_flags` | `list` / `string` | Bullet lists of key bull points, bear points, and accounting/governance/footnote red flags from the 10-K. |
198
 
199
- ### 3. `insider_trades` (11 Columns)
 
 
 
200
 
201
  | Column | Type | Description |
202
  | :--- | :--- | :--- |
@@ -207,6 +222,8 @@ print(top_ideas[["date", "ticker", "name", "score", "pe", "ev_ebit", "net_cash_p
207
  | `shares`, `price`, `value` | `float` | Number of shares traded, execution price per share (USD), and total dollar value (USD). |
208
  | `form4_url` | `string` | Direct URL to the primary SEC Form 4 XML filing on EDGAR. |
209
 
 
 
210
  ---
211
 
212
  ## 🛡️ Data Integrity, Privacy & Caveats
 
54
 
55
  # Plan B — Contrarian Deep-Value US Equities & AI 10-K Analysis
56
 
57
+ > **Daily quantitative & fundamental research dataset** covering deeply discounted, financially resilient, and heavily beaten-down US operating companies across the **NYSE** and **Nasdaq**. Every trading day, Plan B screens ~6,000 SEC XBRL filers using primary **SEC EDGAR XBRL**, **3-year weekly price action**, **Form 4 open-market insider flow**, **FINRA short interest & short volume** (via Massive), **news sentiment**, and **LLM-synthesized 10-K/20-F deep-value memos**.
 
 
58
 
59
  ---
60
 
 
63
  | Metric | Value |
64
  | :--- | :--- |
65
  | **Coverage Window** | `2026-11-02` → `2026-11-13` (12 daily scans) |
66
+ | **Unique Shortlisted Companies** | 66 NYSE / Nasdaq tickers |
67
+ | **Daily Ranking Observations** | 427 rows (131 features per row) |
68
  | **Structured AI 10-K/20-F Memos** | 21 filings analyzed |
69
  | **Open-Market Form 4 Insider Trades** | 376 verified transactions |
70
  | **Update Frequency** | Daily (automated post-market scan) |
 
83
 
84
  ---
85
 
86
+ ## 📁 Dataset Tables
87
 
88
+ Every table is provided in both **CSV** (Kaggle, Pandas, R, DuckDB) and **JSON Lines (`.jsonl`)** (Hugging Face `datasets`, Spark, LLM pipelines).
89
 
90
  | Table / Config | Files | Primary Key | Description |
91
  | :--- | :--- | :--- | :--- |
92
+ | **`daily_rankings`** *(default)* | `daily_rankings.csv`<br>`daily_rankings.jsonl` | `(date, ticker)` | Daily ranked contrarian shortlist (~40 companies/day) with 131 quantitative, XBRL, FINRA short, insider, and AI verdict features. |
93
+ | **`ai_10k_memos`** | `ai_10k_memos.csv`<br>`ai_10k_memos.jsonl` | `(ticker, accession)` | Skeptical value-investor memos generated from Item 1, Item 1A, and Item 7 of each company's latest SEC Form 10-K or 20-F. |
94
+ | **`insider_trades`** | `insider_trades.csv`<br>`insider_trades.jsonl` | `(ticker, owner, kind, date, shares, form4_url)` | Open-market insider purchases (`P`) and sales (`S`) parsed from SEC Form 4 XML filings over the trailing 180 days. |
95
+ | **`scan_stats`** | `scan_stats.csv`<br>`scan_stats.jsonl` | `date` | Daily universe screening funnel: total filers, usable XBRL fundamentals, priced equities, shortlisted count, and paper track record. |
96
 
97
  ---
98
 
99
+ ## 🚀 Quickstart
 
 
 
 
 
 
 
 
100
 
101
+ <details open>
102
+ <summary><b>Python (<code>datasets</code> — Hugging Face)</b></summary>
 
 
 
 
 
103
 
 
 
 
104
  ```python
105
  from datasets import load_dataset
106
 
107
  # Load default config (daily_rankings)
108
+ rankings = load_dataset("elsiddik/planb-deep-value", "daily_rankings", split="train").to_pandas()
109
+ print(rankings[["date", "rank", "ticker", "score", "pe", "ev_ebit", "dd_3y", "ai_verdict"]].head())
 
 
 
110
 
111
+ # Load structured 10-K AI memos & Form 4 insider trades
112
+ memos = load_dataset("elsiddik/planb-deep-value", "ai_10k_memos", split="train").to_pandas()
113
+ insiders = load_dataset("elsiddik/planb-deep-value", "insider_trades", split="train").to_pandas()
114
  ```
115
 
116
+ </details>
117
+
118
+ <details>
119
+ <summary><b>Python (<code>pandas</code> — Kaggle / Local CSV)</b></summary>
120
+
121
  ```python
122
  import pandas as pd
123
 
 
125
  memos = pd.read_csv("ai_10k_memos.csv")
126
  insiders = pd.read_csv("insider_trades.csv")
127
 
128
+ # Filter highest-conviction ideas with net cash and unplanned insider buying
129
+ top_ideas = df[(df["net_cash"] > 0) & (df["insider_unplanned_buy_value"] > 0)].sort_values(["date", "rank"])
130
  print(top_ideas[["date", "ticker", "name", "score", "pe", "ev_ebit", "net_cash_pct", "ai_verdict"]].head(10))
131
  ```
132
 
133
+ </details>
134
+
135
+ ---
136
+
137
+ ## 🎯 Screening & Ranking Methodology
138
+
139
+ Plan B follows a strict **Graham–Klarman–Buffett** deep-value discipline (excluding financials SIC 6000–6799).
140
+
141
+ | Pillar | Hard Quantitative Gate (must pass all 3 simultaneously) |
142
+ | :--- | :--- |
143
+ | **Cheap** | `P/E ≤ 12` **or** `EV/EBIT ≤ 8` **or** `NCAV / Market Cap ≥ 1.0` (Benjamin Graham net-net) |
144
+ | **Safe** | Positive equity, `current_ratio ≥ 1.2`, `liabilities ≤ 2.0× equity` (or net cash), `3Y dilution ≤ 25%`, and `CFO > 0` if `NI < 0` |
145
+ | **Hated** | Price down ≥ **40%** from 3-year weekly high (`dd_3y ≤ -0.40`), `Market Cap ≥ $50M`, `Price ≥ $1.00` |
146
+
147
+ <details>
148
+ <summary><b>Composite Score Formula (0–100), Bonuses, Penalties & AI Adjustment</b></summary>
149
+
150
+ - **Base Weighting:** 40% **Cheap** (`cheap_score`) + 30% **Safe** (`safe_score`) + 30% **Hated** (`hated_score`, blending price drawdown and headline negativity `news_neg`).
151
+ - **Bonuses:** Net open-market Form 4 insider buying (up to +12 pts), same-day cluster buying, and 3-year share count reduction via buybacks (+4 pts).
152
+ - **Penalties:** Share dilution, negative free cash flow, accrual divergence, one-off profits following loss years, high goodwill/M&A intensity, and elevated off-exchange short-volume pressure.
153
+ - **AI 10-K Adjustment:** After reading the 10-K/20-F filing, the composite score is adjusted by the AI analyst's verdict (`CONTRARIAN BUY CANDIDATE`, `WATCH`, or `AVOID`) and conviction (`0–100`).
154
+
155
+ </details>
156
+
157
  ---
158
 
159
  ## 📖 Data Dictionary
160
 
161
+ <details>
162
+ <summary><b>1. <code>daily_rankings</code> (131 Columns)</b></summary>
163
 
164
  | Column | Type | Description |
165
  | :--- | :--- | :--- |
 
189
  | `pri_period`, `pri_assets`, `pri_liab`, `pri_ca`, `pri_cl`, `pri_ar`, `pri_ppe`, `pri_shares` | `mixed` | Balance-sheet values from the same SEC instant one year earlier, used for year-over-year quality tests. |
190
  | `short_pct_float`, `short_ratio`, `short_chg_mom` | `float` | Short interest as % of float, days-to-cover ratio, and change vs the prior report (biweekly FINRA settlement when `short_src`=`finra`, else Yahoo month-over-month). |
191
  | `held_pct_insiders`, `held_pct_institutions` | `float` | Share of the company held by insiders and by institutions. |
192
+ | `short_src`, `short_vol_avg`, `short_vol_last`, `float_shares`, `float_pct`, `avg_daily_volume` | `mixed` | Short-interest source (`finra`), average & latest daily off-exchange short-volume ratio (`0–1`), Massive free-float share count, free-float % (`0–1`), and FINRA average daily share volume. |
193
  | `insider_buyers_sameday`, `insider_unplanned_buy_value` | `int`/`float` | Max distinct insiders buying on one day (Massive Form 4/5 aggregation) and insider purchase USD excluding 10b5-1 pre-planned trades. |
194
  | `activist_form`, `activist_date`, `activist_name`, `activist_pct` | `mixed` | Latest Schedule 13D/13G stake filed against the company (form, date, reporting person, % of class). |
195
  | `tenk_date`, `tenk_accession`, `tenk_form`, `tenk_url` | `string` | Filing date, SEC accession number, form type (`10-K` / `20-F`), and direct SEC EDGAR archive URL. |
196
  | `ai_verdict`, `ai_conviction`, `ai_balance_sheet`, `ai_value_trap_risk`, `ai_one_liner` | `mixed` | AI 10-K analyst summary fields (`CONTRARIAN BUY CANDIDATE` / `WATCH` / `AVOID`, conviction `0–100`, balance sheet rating, value-trap risk, and one-line thesis). |
197
 
198
+ </details>
199
+
200
+ <details>
201
+ <summary><b>2. <code>ai_10k_memos</code> (21 Columns)</b></summary>
202
 
203
  | Column | Type | Description |
204
  | :--- | :--- | :--- |
 
208
  | `one_liner`, `business`, `why_hated`, `capital_allocation`, `management` | `string` | Concise investment synthesis covering the business model, market pessimism, buybacks/dividends/M&A, and leadership. |
209
  | `bull`, `bear`, `red_flags` | `list` / `string` | Bullet lists of key bull points, bear points, and accounting/governance/footnote red flags from the 10-K. |
210
 
211
+ </details>
212
+
213
+ <details>
214
+ <summary><b>3. <code>insider_trades</code> (11 Columns)</b></summary>
215
 
216
  | Column | Type | Description |
217
  | :--- | :--- | :--- |
 
222
  | `shares`, `price`, `value` | `float` | Number of shares traded, execution price per share (USD), and total dollar value (USD). |
223
  | `form4_url` | `string` | Direct URL to the primary SEC Form 4 XML filing on EDGAR. |
224
 
225
+ </details>
226
+
227
  ---
228
 
229
  ## 🛡️ Data Integrity, Privacy & Caveats
daily_rankings.csv CHANGED
The diff for this file is too large to render. See raw diff
 
daily_rankings.jsonl CHANGED
The diff for this file is too large to render. See raw diff