{"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/shallow-decision-trees-for-explainable-k","title":"Shallow decision trees for explainable $k$-means clustering","arxiv_id":"2112.14718","date":"2021-12-29","proceeding":null,"authors":["Eduardo Laber","Lucas Murtinho","Felipe Oliveira"],"abstract":"A number of recent works have employed decision trees for the construction of explainable partitions that aim to minimize the $k$-means cost function. These works, however, largely ignore metrics related to the depths of the leaves in the resulting tree, which is perhaps surprising considering how the explainability of a decision tree depends on these depths. To fill this gap in the literature, we propose an efficient algorithm that takes into account these metrics. In experiments on 16 datasets, our algorithm yields better results than decision-tree clustering algorithms such as the ones presented in \\cite{dasgupta2020explainable}, \\cite{frost2020exkmc}, \\cite{laber2021price} and \\cite{DBLP:conf/icml/MakarychevS21}, typically achieving lower or equivalent costs with considerably shallower trees. We also show, through a simple adaptation of existing techniques, that the problem of building explainable partitions induced by binary trees for the $k$-means cost function does not admit an $(1+\\epsilon)$-approximation in polynomial time unless $P=NP$, which justifies the quest for approximation algorithms and/or heuristics.","url_abs":"https://arxiv.org/abs/2112.14718v2","url_pdf":"https://arxiv.org/pdf/2112.14718v2.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":"shallow-decision-trees-for-explainable-k","repo_url":"https://github.com/lmurtinho/shallowtree","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"clustering","task_name":"Clustering"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2112.14718","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2112.14718"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+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":"deterministic:regex_extraction","url":"https://github.com/lmurtinho/ExKMC","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"deterministic:regex_extraction","url":"https://github.com/lmurtinho/ShallowTree","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/lmurtinho/shallowtree","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_honours":1,"ran_violates":1,"ran_fixture":2},"by_repo_kind":{"official":{"samples":1,"ran":1,"repositories":1},"found_in_text":{"samples":3,"ran":3,"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":"70b02ab5802a4ae1","entry":"get_distances","repo":"lmurtinho/shallowtree","repo_kind":"official","path":"ShallowTree/ShallowTree.py","file_url":"https://github.com/lmurtinho/shallowtree/blob/HEAD/ShallowTree/ShallowTree.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":2,"contract_check":"HONOURS","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"70b02ab5802a4ae1"}},{"code_sha256_prefix":"6998c9ef41480a73","entry":"convert_input","repo":"lmurtinho/exkmc","repo_kind":"found_in_text","path":"ExKMC/Tree.py","file_url":"https://github.com/lmurtinho/exkmc/blob/HEAD/ExKMC/Tree.py","link_basis":"first_harvest_node","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6998c9ef41480a73"}},{"code_sha256_prefix":"7a862fe93d2b7494","entry":"find_first_above","repo":"lmurtinho/exkmc","repo_kind":"found_in_text","path":"ExKMC/Tree.py","file_url":"https://github.com/lmurtinho/exkmc/blob/HEAD/ExKMC/Tree.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"7a862fe93d2b7494"}},{"code_sha256_prefix":"d968d75cec08a77c","entry":"get_separations","repo":"lmurtinho/exkmc","repo_kind":"found_in_text","path":"ExKMC/Tree.py","file_url":"https://github.com/lmurtinho/exkmc/blob/HEAD/ExKMC/Tree.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"d968d75cec08a77c"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}