File size: 14,633 Bytes
58da59f ea3bd20 68daca9 ea3bd20 68daca9 ea3bd20 68daca9 ea3bd20 68daca9 ea3bd20 68daca9 ea3bd20 68daca9 58da59f 9fbc9fa 969542b 58da59f 969542b 58da59f 969542b 58da59f 68daca9 58da59f 969542b 58da59f 68daca9 58da59f 969542b 58da59f 68daca9 969542b 58da59f 969542b 58da59f | 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 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 | ---
dataset_info:
- config_name: processed_events_campaign_finance
data_files:
- split: train
path: data/processed/events_campaign_finance.csv
- config_name: processed_events_geographical_industry
data_files:
- split: train
path: data/processed/events_geographical_industry.csv
- config_name: processed_events_lobbying
data_files:
- split: train
path: data/processed/events_lobbying.csv
- config_name: raw_527_committees
data_files:
- split: train
path: data/raw/527_data_open_secrets/cmtes527.csv
- config_name: raw_527_expenditures
data_files:
- split: train
path: data/raw/527_data_open_secrets/expends527.csv
- config_name: raw_527_receipts
data_files:
- split: train
path: data/raw/527_data_open_secrets/rcpts527.csv
- config_name: raw_voteview_members
data_files:
- split: train
path: data/raw/HSall_members_VoteView.csv
- config_name: raw_voteview_rollcalls
data_files:
- split: train
path: data/raw/HSall_rollcalls.csv
- config_name: raw_voteview_votes
data_files:
- split: train
path: data/raw/HSall_votes.csv
- config_name: raw_voteview_ideology
data_files:
- split: train
path: data/raw/ideology_scores_quarterly_VoteView.csv
- config_name: raw_cf_candidates
data_files:
- split: train
path: data/raw/campaign_finance_open_secrets/cands*.csv
- config_name: raw_cf_committees
data_files:
- split: train
path: data/raw/campaign_finance_open_secrets/cmtes*.csv
- config_name: raw_cf_expenditures
data_files:
- split: train
path: data/raw/campaign_finance_open_secrets/expenditures*.csv
- config_name: raw_cf_individuals
data_files:
- split: train
path: data/raw/campaign_finance_open_secrets/indivs*.csv
- config_name: raw_cf_pac_other
data_files:
- split: train
path: data/raw/campaign_finance_open_secrets/pac_other*.csv
- config_name: raw_cf_pacs
data_files:
- split: train
path: data/raw/campaign_finance_open_secrets/pacs*.csv
- config_name: raw_committee_assignments
data_files:
- split: train
path: data/raw/committee_assignments.csv
- config_name: raw_company_sic
data_files:
- split: train
path: data/raw/company_sic_data.csv
- config_name: raw_congress_terms
data_files:
- split: train
path: data/raw/congress_terms_all_github.csv
- config_name: raw_sec_financials
data_files:
- split: train
path: data/raw/sec_quarterly_financials.csv
- config_name: raw_district_industries_estimates
data_files:
- split: train
path: data/raw/district_industries/*_CB_estimates.csv
- config_name: raw_district_industries_surveys
data_files:
- split: train
path: data/raw/district_industries/*_CB_survey.csv
- config_name: raw_district_industries_dates
data_files:
- split: train
path: data/raw/district_industries/survey_release_dates.csv
- config_name: raw_naics_2012_crosswalk
data_files:
- split: train
path: data/raw/industry_codes_NAICS/2012-NAICS-to-SIC-Crosswalk.csv
- config_name: raw_naics_2013_mappings
data_files:
- split: train
path: data/raw/industry_codes_NAICS/2013-CAT_to_SIC_to_NAICS_mappings.csv
- config_name: raw_naics_2017_crosswalk
data_files:
- split: train
path: data/raw/industry_codes_NAICS/2017-NAICS-to-SIC-Crosswalk.csv
- config_name: raw_naics_2022_crosswalk
data_files:
- split: train
path: data/raw/industry_codes_NAICS/2022-NAICS-to-SIC-Crosswalk.csv
- config_name: raw_naics_effective_dates
data_files:
- split: train
path: data/raw/industry_codes_NAICS/classification_effective_dates.csv
- config_name: raw_lobbyview_bills
data_files:
- split: train
path: data/raw/lobbying_data_lobbyview/bills.csv
- config_name: raw_lobbyview_clients
data_files:
- split: train
path: data/raw/lobbying_data_lobbyview/clients.csv
- config_name: raw_lobbyview_issue_text
data_files:
- split: train
path: data/raw/lobbying_data_lobbyview/issue_text.csv
- config_name: raw_lobbyview_issues
data_files:
- split: train
path: data/raw/lobbying_data_lobbyview/issues.csv
- config_name: raw_lobbyview_network
data_files:
- split: train
path: data/raw/lobbying_data_lobbyview/network.csv
- config_name: raw_lobbyview_reports
data_files:
- split: train
path: data/raw/lobbying_data_lobbyview/reports.csv
# --- Source code (src/) ---
# config.py and temporal_data.py live at the top of the package; the data-prep
# scripts, node_features.py, and feature_lookups.py live in src/data_prep/.
- config_name: src_config
data_files:
- split: train
path: src/config.py
- config_name: src_temporal_data
data_files:
- split: train
path: src/temporal_data.py
- config_name: src_build_campaign_events
data_files:
- split: train
path: src/data_prep/build_campaign_events.py
- config_name: src_build_geographical_edges
data_files:
- split: train
path: src/data_prep/build_geographical_edges.py
- config_name: src_build_lobbying_events
data_files:
- split: train
path: src/data_prep/build_lobbying_events.py
- config_name: src_node_features
data_files:
- split: train
path: src/data_prep/node_features.py
- config_name: src_feature_lookups
data_files:
- split: train
path: src/data_prep/feature_lookups.py
license: cc-by-nc-sa-4.0
task_categories:
- graph-ml
- tabular-classification
tags:
- finance
- politics
- legal
- gnn
- temporal-graph
pretty_name: "HillStreet: Relational Congressional Trading Dataset"
size_categories:
- 10M<n<100M
---
# **This sample was made by sampling 1,000 rows from every table of HillStreet.**
---
## HillStreet: A Relational Dataset for Evaluating Information Channels in Congressional Trading
**HillStreet** is a large-scale, longitudinal dataset and multimodal dynamic graph formalizing the intersection of Capitol Hill and Wall Street. It spans **13.5 years** of mandatory STOCK Act disclosures (July 2012–December 2025), unifying the congressional trading ecosystem into a single, machine-learning-ready framework.
### Dataset Summary
The dataset represents the relationship between **1,137 legislators** and **6,825 companies**. By framing congressional trading as a **dynamic bipartite graph**, HillStreet allows researchers to treat trade signal validation as an edge classification task.
- **Nodes:** Legislators (session-specific) and Publicly Traded Companies.
- **Target Edges:** Individual stock trades.
- **Structural Edges:** Lobbying records, campaign finance (PAC/527) contributions, and geographical/industrial-constituency alignments.
### Dataset Structure
HillStreet is divided into pre-built graph objects for deep learning, a relational tabular database accessed via Hugging Face configurations, and the source code used to build everything from the raw tables.
#### 1. Dynamic Graph Objects (`.pt` & `.npy`)
For immediate use in Graph Neural Networks (GNNs) and Temporal Graph Networks (TGNs), the core of HillStreet consists of annual **PyTorch Geometric Temporal** objects.
- **Graph Files:** `hillstreet_temporal_graph_YEAR.pt` — one annual shard per active year.
- **Temporal Integrity:** Every node feature and edge is instantiated based on its **public disclosure date**, not its reference date, ensuring a look-ahead-bias-free environment for backtesting. Structural edges additionally carry a `last_seen` timestamp (most recent interaction) alongside `t` (the start of the relationship), so recency/days-since features can be computed at load time.
- **ID Mappings:** `src_id_map.npy` (Legislator Bioguide IDs → row index) and `dst_id_map.npy` (Company Tickers → row index). These define the global node ordering the static node tensors are aligned to.
- **Node Features:** `node_features_static.pt` (the five static node tensors) plus `node_features_meta.json` (dimensions and categorical vocabularies). Produced by Phase 3 of the pipeline and aligned to the ID maps above. With the default configuration flags, legislator features combine a trading-performance summary, chamber/party/leadership indicators, DW-NOMINATE ideology coordinates (evaluated as of the snapshot date), and committee-membership indicators; company features encode the SIC industry division. Integer category indices for legislator **state** and company **sector**/**industry** are also provided for use as learned embeddings. Note that Census district employment enters the graph as **geo edge weights** (not node features), and SEC fiscal facts are shipped as a raw table that can be enabled as company node features via a configuration flag (off by default).
#### 2. Relational Tables (Hugging Face Configs)
For researchers using flat-feature models (XGBoost, LightGBM) or custom graph builders, the structural connective tissue is provided as multiple dataset configurations. You can load these individually using the Hugging Face `datasets` library (e.g., `load_dataset("benroodman/HillStreet", "processed_events_lobbying")`).
**Processed Edge Tables:**
- `processed_events_lobbying`: Mappings of legislative activity to corporate nodes.
- `processed_events_campaign_finance`: Itemized PAC/527 donations broadcasted to corporate sectors.
- `processed_events_geographical_industry`: Industrial-constituency edges linking legislators to companies in their districts.
**Raw Source Tables:**
The raw, underlying tables are also available as distinct configurations for custom aggregations and feature engineering:
- **Campaign Finance:** `raw_cf_*` and `raw_527_*` configs.
- **Legislator Data:** `raw_voteview_*` configs and `raw_committee_assignments`.
- **Corporate & Industry:** `raw_sec_financials`, `raw_naics_*` crosswalks, and `raw_district_industries_*` configs.
- **Lobbying:** `raw_lobbyview_*` configs.
#### 3. Source Code (`src/`)
The complete pipeline that turns the raw tables into the processed edge tables and graph objects is included as `src_*` configurations. The package is laid out as:
```
src/
├── __init__.py
├── config.py # central paths + feature flags
├── temporal_data.py # pipeline orchestrator (Phases 1–4)
└── data_prep/
├── __init__.py
├── build_lobbying_events.py
├── build_campaign_events.py
├── build_geographical_edges.py
├── node_features.py
└── feature_lookups.py
```
- **`config.py`** — Resolves the project root and centralizes every input/output path and the feature flags (which structural channels and node-feature blocks are enabled). The data-prep scripts import it via `from src import config`.
- **`build_lobbying_events.py`** — Maps lobbying clients to tickers (via NAICS→SIC→ticker crosswalks) and links them to sponsoring legislators, writing `data/processed/events_lobbying.csv`.
- **`build_campaign_events.py`** — Aggregates corporate PAC and 527 contributions above a conviction threshold, maps donors to legislators, and writes `data/processed/events_campaign_finance.csv`.
- **`build_geographical_edges.py`** — Builds industrial-constituency edges from Census County Business Patterns district data (top industries per district by employment), writing `data/processed/events_geographical_industry.csv`.
- **`temporal_data.py`** — The orchestrator. Ingests the trade table and the three processed event tables, broadcasts sector-level structural events to individual tickers, collapses repeated structural pairs into single weighted edges (keeping both first-seen `time` and `last_seen`), writes the per-channel edge parquets, and shards the unified edge stream into annual PyTorch Geometric `TemporalData` objects with global node-id maps. It then invokes Phase 3 to build the aligned static node tensors.
- **`node_features.py`** — Phase 3. Once `temporal_data.py` has written `src_id_map.npy` / `dst_id_map.npy`, `build_node_features()` assembles the five static node tensors (legislator features, legislator state embedding index, company features, company sector and industry embedding indices) **aligned to those maps**, saving `node_features_static.pt` and `node_features_meta.json`. It is called automatically by `temporal_data.py` (skip with `--skip_node_features`); it is not run standalone.
- **`feature_lookups.py`** — Helper module imported by `node_features.py`. Provides the as-of-date lookup classes (`TermLookup`, `PoliticianBioLookup`, `IdeologyLookup`, `CommitteeLookup`, `CompanySICLookup`, `CompanyFinancialsLookup`) that resolve a legislator's or company's attributes from the raw tables (congress terms, DW-NOMINATE ideology, committee assignments, company SIC, SEC financials) at a given snapshot date. It is not executed directly.
### Reproduction Pipeline
All commands are run from the repository root. The three builders are independent of one another and produce the processed event tables that `temporal_data.py` consumes; run them first, then the orchestrator:
```bash
# 1. Build the three processed structural-event tables (any order)
python src/data_prep/build_lobbying_events.py
python src/data_prep/build_campaign_events.py
python src/data_prep/build_geographical_edges.py
# 2. Build edge parquets, annual PyG shards, node-id maps, and aligned node features
# (Phase 3 node features run automatically at the end)
python src/temporal_data.py
```
`temporal_data.py` expects the trade table at `data/processed/ml_dataset_continuous.csv`. It does **not** call the three build scripts itself — it reads their CSV outputs — but it **does** invoke `node_features.py` (which imports `feature_lookups.py`) as its final phase, so both must be present.
### Feature Engineering & Normalization
To stabilize variance in graph training, continuous features are transformed using signed log-scaling:
$$x' = \text{sign}(x) \times \log(1 + |x|)$$
### Intended Use
- **Trade Signal Validation:** Determining if a trade constitutes a meaningful price signal based on political context.
- **Graph Representation Learning:** A benchmark for GNNs and TGNs.
> [!WARNING]
> **Non-Intended Use:** This dataset is for research purposes only. It is not designed for legal determinations of insider trading nor for real-time automated trading. |