{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/compact-representation-of-uncertainty-in-1","title":"Data Structures & Algorithms for Exact Inference in Hierarchical Clustering","arxiv_id":"2002.11661","date":"2020-02-26","proceeding":null,"authors":["Craig S. Greenberg","Sebastian Macaluso","Nicholas Monath","Ji-Ah Lee","Patrick Flaherty","Kyle Cranmer","Andrew Mcgregor","Andrew McCallum"],"abstract":"Hierarchical clustering is a fundamental task often used to discover meaningful structures in data, such as phylogenetic trees, taxonomies of concepts, subtypes of cancer, and cascades of particle decays in particle physics. Typically approximate algorithms are used for inference due to the combinatorial number of possible hierarchical clusterings. In contrast to existing methods, we present novel dynamic-programming algorithms for \\emph{exact} inference in hierarchical clustering based on a novel trellis data structure, and we prove that we can exactly compute the partition function, maximum likelihood hierarchy, and marginal probabilities of sub-hierarchies and clusters. Our algorithms scale in time and space proportional to the powerset of $N$ elements which is super-exponentially more efficient than explicitly considering each of the (2N-3)!! possible hierarchies. Also, for larger datasets where our exact algorithms become infeasible, we introduce an approximate algorithm based on a sparse trellis that compares well to other benchmarks. Exact methods are relevant to data analyses in particle physics and for finding correlations among gene expression in cancer genomics, and we give examples in both areas, where our algorithms outperform greedy and beam search baselines. In addition, we consider Dasgupta's cost with synthetic data.","url_abs":"https://arxiv.org/abs/2002.11661v3","url_pdf":"https://arxiv.org/pdf/2002.11661v3.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"compact-representation-of-uncertainty-in-1","repo_url":"https://github.com/SebastianMacaluso/ClusterTrellis","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"clustering","task_name":"Clustering"},{"task_slug":"small-data","task_name":"Small Data Image Classification"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2002.11661","atlas_url":"https://app.syntology.ai/?focus=2002.11661","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2002.11661"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/SebastianMacaluso/ClusterTrellis","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":6},"by_repo_kind":{"listed":{"samples":6,"ran":6,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"fc32f46ff089b0d9","entry":"getConstituents","repo":"SebastianMacaluso/ClusterTrellis","repo_kind":"listed","path":"src/ClusterTrellis/utils.py","file_url":"https://github.com/SebastianMacaluso/ClusterTrellis/blob/HEAD/src/ClusterTrellis/utils.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"fc32f46ff089b0d9"}},{"code_sha256_prefix":"553e5a832c97c087","entry":"get_delta_LR","repo":"SebastianMacaluso/ClusterTrellis","repo_kind":"listed","path":"src/ClusterTrellis/Ginkgo_likelihood.py","file_url":"https://github.com/SebastianMacaluso/ClusterTrellis/blob/HEAD/src/ClusterTrellis/Ginkgo_likelihood.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"553e5a832c97c087"}},{"code_sha256_prefix":"c638b5451a407e76","entry":"get_leaves","repo":"SebastianMacaluso/ClusterTrellis","repo_kind":"listed","path":"src/ClusterTrellis/utils.py","file_url":"https://github.com/SebastianMacaluso/ClusterTrellis/blob/HEAD/src/ClusterTrellis/utils.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"c638b5451a407e76"}},{"code_sha256_prefix":"4a24f023d0dcd220","entry":"get_logger","repo":"SebastianMacaluso/ClusterTrellis","repo_kind":"listed","path":"src/ClusterTrellis/utils.py","file_url":"https://github.com/SebastianMacaluso/ClusterTrellis/blob/HEAD/src/ClusterTrellis/utils.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"4a24f023d0dcd220"}},{"code_sha256_prefix":"ce662a5e23440900","entry":"split_logLH_with_stop_nonstop_prob","repo":"SebastianMacaluso/ClusterTrellis","repo_kind":"listed","path":"src/ClusterTrellis/Ginkgo_likelihood.py","file_url":"https://github.com/SebastianMacaluso/ClusterTrellis/blob/HEAD/src/ClusterTrellis/Ginkgo_likelihood.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"ce662a5e23440900"}},{"code_sha256_prefix":"a3604e6497a6b57e","entry":"split_logLH_without_non_stop_prob","repo":"SebastianMacaluso/ClusterTrellis","repo_kind":"listed","path":"src/ClusterTrellis/Ginkgo_likelihood.py","file_url":"https://github.com/SebastianMacaluso/ClusterTrellis/blob/HEAD/src/ClusterTrellis/Ginkgo_likelihood.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"a3604e6497a6b57e"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}