Detect restaurant clusters — groups of restaurants sharing violation signatures within the same zipcode. Identifies systemic issues (e.g. shared-basement pest migration) vs individual operator failures.
Query the Louvain community detection results over the restaurant-to- restaurant similarity graph (built from shared violation codes, scoped by zipcode) and surface cluster membership + shared violation patterns.
data/processed/restaurant_clusters.parquet (camis, cluster_id)data/processed/restaurant_similarity_edges.parquet
(src, dst, shared_codes, jaccard, zipcode)data/processed/restaurant_state.parquet for names + addressesdata/processed/violation_history.parquet to compute shared
violation codes within the clustercluster_id, then list all members{
"cluster_id": 17,
"restaurant_count": 9,
"zipcode": "10458",
"members": [
{"camis": 40012345, "dba": "Chen's Kitchen", "label": "repeat_offender"},
{"camis": 40012400, "dba": "Golden Dragon", "label": "repeat_offender"},
{"camis": 40012501, "dba": "Bronx Deli", "label": "standard"}
],
"shared_violation_codes": ["04L", "04N"],
"dominant_edge_type": "PEST_LINK",
"avg_jaccard": 0.42,
"geographic_span_m": 340,
"assessment": "Pest migration cluster — 7 of 9 share pest violations and sit within 340m. Likely shared-basement infrastructure issue rather than operator failure.",
"recommendation": "Refer to HPD for building-level inspection. Individual extermination will recur until structural fix."
}