{"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/comparing-distributions-ell_1-geometry","title":"Comparing distributions: $\\ell_1$ geometry improves kernel two-sample testing","arxiv_id":"1909.09264","date":"2019-09-19","proceeding":null,"authors":["M. Scetbon","G. Varoquaux"],"abstract":"Are two sets of observations drawn from the same distribution? This problem is a two-sample test. Kernel methods lead to many appealing properties. Indeed state-of-the-art approaches use the $L^2$ distance between kernel-based distribution representatives to derive their test statistics. Here, we show that $L^p$ distances (with $p\\geq 1$) between these distribution representatives give metrics on the space of distributions that are well-behaved to detect differences between distributions as they metrize the weak convergence. Moreover, for analytic kernels, we show that the $L^1$ geometry gives improved testing power for scalable computational procedures. Specifically, we derive a finite dimensional approximation of the metric given as the $\\ell_1$ norm of a vector which captures differences of expectations of analytic functions evaluated at spatial locations or frequencies (i.e, features). The features can be chosen to maximize the differences of the distributions and give interpretable indications of how they differs. Using an $\\ell_1$ norm gives better detection because differences between representatives are dense as we use analytic kernels (non-zero almost everywhere). The tests are consistent, while much faster than state-of-the-art quadratic-time kernel-based tests. Experiments on artificial and real-world problems demonstrate improved power/time tradeoff than the state of the art, based on $\\ell_2$ norms, and in some cases, better outright power than even the most expensive quadratic-time tests.","url_abs":"https://arxiv.org/abs/1909.09264v2","url_pdf":"https://arxiv.org/pdf/1909.09264v2.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":"comparing-distributions-ell_1-geometry","repo_url":"https://github.com/meyerscetbon/L1_test","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok"}},{"paper_slug":"comparing-distributions-ell_1-geometry","repo_url":"https://github.com/meyerscetbon/l1_two_sample_test","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"none","reach":null}],"tasks":[{"task_slug":"hypothesis-testing","task_name":"Two-sample testing"},{"task_slug":"two","task_name":"Vocal Bursts Valence Prediction"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=1909.09264","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"1909.09264"}},"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":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/meyerscetbon/l1_two_sample_test","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/meyerscetbon/L1_test","reach":{"status":"ok"}}],"summary":{"ran_fixture":1,"ran_violates":1,"ran_honours":1},"by_repo_kind":{"official":{"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":3,"samples":[{"code_sha256_prefix":"621f12528370e07c","entry":"compute_stat_ME","repo":"meyerscetbon/l1_two_sample_test","repo_kind":"official","path":"l1_two_sample_test.py","file_url":"https://github.com/meyerscetbon/l1_two_sample_test/blob/HEAD/l1_two_sample_test.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"621f12528370e07c"}},{"code_sha256_prefix":"5d101457cc360c0d","entry":"gauss_kernel","repo":"meyerscetbon/l1_two_sample_test","repo_kind":"official","path":"l1_two_sample_test.py","file_url":"https://github.com/meyerscetbon/l1_two_sample_test/blob/HEAD/l1_two_sample_test.py","link_basis":"first_harvest_node","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"5d101457cc360c0d"}},{"code_sha256_prefix":"ee3cb22dfd83edb6","entry":"sf_naka","repo":"meyerscetbon/l1_two_sample_test","repo_kind":"official","path":"l1_two_sample_test.py","file_url":"https://github.com/meyerscetbon/l1_two_sample_test/blob/HEAD/l1_two_sample_test.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"ee3cb22dfd83edb6"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}