{"id":15444339,"url":"https://github.com/qbarthelemy/pypermut","last_synced_at":"2025-04-19T20:25:28.480Z","repository":{"id":59119834,"uuid":"360962593","full_name":"qbarthelemy/PyPermut","owner":"qbarthelemy","description":"Python package for permutation tests, for statistics and machine learning.","archived":false,"fork":false,"pushed_at":"2024-10-11T06:53:58.000Z","size":199,"stargazers_count":20,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-18T14:12:29.008Z","etag":null,"topics":["machine-learning","multiple-comparisons","nonparametric-tests","permutation-test","post-hoc","python","scientific-computing","statistics"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/qbarthelemy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-04-23T17:43:11.000Z","updated_at":"2024-10-14T08:24:32.000Z","dependencies_parsed_at":"2024-05-27T22:06:46.283Z","dependency_job_id":"e8288ffc-60cc-4a7e-aeac-73e2c83dfb41","html_url":"https://github.com/qbarthelemy/PyPermut","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qbarthelemy%2FPyPermut","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qbarthelemy%2FPyPermut/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qbarthelemy%2FPyPermut/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qbarthelemy%2FPyPermut/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qbarthelemy","download_url":"https://codeload.github.com/qbarthelemy/PyPermut/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249793545,"owners_count":21326560,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["machine-learning","multiple-comparisons","nonparametric-tests","permutation-test","post-hoc","python","scientific-computing","statistics"],"created_at":"2024-10-01T19:40:22.459Z","updated_at":"2025-04-19T20:25:28.473Z","avatar_url":"https://github.com/qbarthelemy.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# P*y*\u0026#43004;*ermut*\n\n[![Code PythonVersion](https://img.shields.io/badge/python-3.8+-blue)](https://img.shields.io/badge/python-3.8+-blue)\n[![License](https://img.shields.io/badge/licence-BSD--3--Clause-green)](https://img.shields.io/badge/license-BSD--3--Clause-green)\n[![Country](https://img.shields.io/badge/made%20in-France-blue)](https://img.shields.io/badge/made%20in-France-blue)\n\nPyPermut is a Python package implementing permutation tests, for statistics and\nmachine learning.\n\nPyPermut is distributed under the open source 3-clause BSD license.\n\n## Description\n\nIn a nutshell, this package extends some parametric and non-parametric\n[statistical tests](https://docs.scipy.org/doc/scipy/reference/stats.html#statistical-tests)\ninto permutation tests for multivariate samples, allowing the computation of\nexact p-values and the correction for multiple tests.\n\nFuthermore, this package offers several functions for machine learning, like a\ngeneric permutation test for any metric based on the predictions of a model\n(for eg, AUROC, AUPR, negative log-likelihood, etc).\n\n#### Permutations for statistical tests\n\nThis package implements several\n[permutation tests](https://en.wikipedia.org/wiki/Permutation_tests)\n(also called randomization tests).\n\nCorrelation tests:\n- Pearson product-moment correlation r test,\n- Spearman rank-order correlation \u0026#961; test.\n\nOrdinal and numerical\n[location tests](https://en.wikipedia.org/wiki/Location_test):\n- Student's t-test for related samples,\n- Student's t-test for independent samples\n(and its adaptation into Welch's unequal variances t-test),\n- Wilcoxon (signed-rank) T test,\n- Mann-Whitney U test,\n- one-way ANOVA for independent samples,\n- Kruskal-Wallis H test,\n- Friedman \u0026#967;\u0026#178; test.\n\nIn permutation tests, the null distribution is sampled by random permutations\nof measurements. Making no hypothesis on the statistic distribution, the\np-value is defined as the proportion of the null distribution with test\nstatistic greater (or, for certain test statistic, lower) than or equal to the\ntest statistic of the observed data.\nWhen all permutations are evaluated, these permutation tests give\n[exact tests](https://en.wikipedia.org/wiki/Exact_test).\n\n![](/doc/fig_approx_vs_exact.png)\n\nIn case of several variables, they naturally perform a correction for\n[multiple tests](https://en.wikipedia.org/wiki/Multiple_comparisons_problem):\n- rmax permutation test from Pearson r correlations,\n- \u0026#961;max permutation test from Spearman \u0026#961; correlations,\n- tmax permutation test from Student's t-tests for related samples,\n- tmax permutation test from Student's t-tests for independent samples,\n- Tmin permutation test from Wilcoxon T tests,\n- Umin permutation test from Mann-Whitney U tests,\n- Fmax permutation test from one-way ANOVAs for independent samples,\n- Hmax permutation test from Kruskal-Wallis H tests,\n- \u0026#967;max permutation test from Friedman \u0026#967;\u0026#178; tests.\n\nIn the context of correlated variables, they efficiently correct the\n[family-wise error rate](https://en.wikipedia.org/wiki/Family-wise_error_rate),\nbeing an alternative to the well-known\n[Bonferroni correction](https://en.wikipedia.org/wiki/Bonferroni_correction)\nwhich would lead to an undesirable lack of statistical power.\nThese multiple variables can be useful to compute pairwise post-hoc tests.\n\n#### Decision tree for statistical tests\n\n![](/doc/fig_tree_statistical_tests.svg)\n\n#### How to use PyPermut\n\nSee `examples`.\n\n#### References\n\nWestfall and Young, *Resampling-based multiple testing: examples and methods*\n*for p-value adjustment*, Wiley-Blackwell, 1993.\n\nPesarin, *Multivariate Permutation Tests – With Applications in Biostatistics*,\nWiley-Blackwell, 2001.\n\nNichols and Holmes, \"Nonparametric permutation tests for functional\nneuroimaging: A primer with examples\", *Human Brain Mapping*, vol 15, pp 1-25,\n2001.\n\nEdgington and Onghena, *Randomization Tests, Fourth Edition*, Chapman and\nHall/CRC, 2007.\n\n## Documentation\n\nTODO: put documentation on RTD.\n\n## Installation\n\n#### From sources\n\nTo install PyPermut as a standard module:\n```shell \npip install path/to/pypermut\n```\n\nTo install PyPermut in editable / development mode, in the folder:\n```shell\npython setup.py develop\n```\n\n## Testing\n\nUse `pytest`.\n\n## Authors\n\nQuentin Barthélemy, an anonymous researcher and Louis Mayaud,\nunder the wisdom of [Marco Congedo](https://github.com/Marco-Congedo).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqbarthelemy%2Fpypermut","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqbarthelemy%2Fpypermut","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqbarthelemy%2Fpypermut/lists"}