{"id":13689271,"url":"https://github.com/gregversteeg/NPEET","last_synced_at":"2025-05-01T23:33:19.108Z","repository":{"id":21729222,"uuid":"25050914","full_name":"gregversteeg/NPEET","owner":"gregversteeg","description":"Non-parametric Entropy Estimation Toolbox","archived":false,"fork":false,"pushed_at":"2022-10-05T20:58:40.000Z","size":311,"stargazers_count":352,"open_issues_count":10,"forks_count":88,"subscribers_count":18,"default_branch":"master","last_synced_at":"2024-08-03T15:16:43.495Z","etag":null,"topics":["entropy","estimator","information-theory","python"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gregversteeg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-10-10T19:57:02.000Z","updated_at":"2024-08-02T08:31:45.000Z","dependencies_parsed_at":"2023-01-11T21:20:07.544Z","dependency_job_id":null,"html_url":"https://github.com/gregversteeg/NPEET","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregversteeg%2FNPEET","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregversteeg%2FNPEET/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregversteeg%2FNPEET/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregversteeg%2FNPEET/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gregversteeg","download_url":"https://codeload.github.com/gregversteeg/NPEET/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224282200,"owners_count":17285788,"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":["entropy","estimator","information-theory","python"],"created_at":"2024-08-02T15:01:40.883Z","updated_at":"2024-11-12T13:31:13.775Z","avatar_url":"https://github.com/gregversteeg.png","language":"Python","readme":"NPEET\n=====\n\nNon-parametric Entropy Estimation Toolbox\n\nThis package contains Python code implementing several entropy estimation functions for both discrete and continuous variables. Information theory provides a model-free way find structure in complex systems, but difficulties in estimating these quantities has traditionally made these techniques infeasible. This package attempts to allay these difficulties by making modern state-of-the-art entropy estimation methods accessible in a single easy-to-use python library.\n\nThe implementation is very simple. It only requires that numpy/scipy be installed. It includes estimators for entropy, mutual information, and conditional mutual information for both continuous and discrete variables. Additionally it includes a KL Divergence estimator for continuous distributions and mutual information estimator between continuous and discrete variables along with some non-parametric tests for evaluating estimator performance.\n\n**The main documentation is in \u003ca href=\"https://github.com/gregversteeg/NPEET/blob/master/npeet_doc.pdf\"\u003enpeet_doc.pdf\u003c/a\u003e.**\nIt includes description of functions, references, implementation details, and technical discussion about the difficulties in estimating entropies. The \u003ca href=\"http://www.isi.edu/~gregv/npeet.tgz\"\u003ecode is available here\u003c/a\u003e. It requires \u003ca href=\"http://www.scipy.org\"\u003escipy\u003c/a\u003e 0.12 or greater. This package is mainly geared to estimating information-theoretic quantities for continuous variables in a non-parametric way. If your primary interest is in discrete entropy estimation, particularly with undersampled data, please see \u003ca href=\"http://thoth-python.org\"\u003ethis package\u003c/a\u003e.\u003c/p\u003e\n\nExample installation and usage:\n\n```bash\ngit clone https://github.com/gregversteeg/NPEET.git\ncd NPEET\npip install .\n```\n\n```python\n\u003e\u003e\u003e from npeet import entropy_estimators as ee\n\u003e\u003e\u003e x = [[1.3],[3.7],[5.1],[2.4],[3.4]]\n\u003e\u003e\u003e y = [[1.5],[3.32],[5.3],[2.3],[3.3]]\n\u003e\u003e\u003e ee.mi(x,y)\nOut: 0.168\n```\n\nAnother example:\n\n```python\nimport numpy as np\nfrom npeet import entropy_estimators as ee\n\nmy_data = np.genfromtxt('my_file.csv', delimiter=',')  # If you look in the documentation, there is a way to skip header rows and other things\n\nx = my_data[:,[5]].tolist()\ny = my_data[:,[9]].tolist()\nz = my_data[:,[15,17]].tolist()\nprint(ee.cmi(x, y, z))\nprint(ee.shuffle_test(ee.cmi, x, y, z, ci=0.95, ns=1000))\n```\n\nThis prints the mutual information between column 5 and 9, conditioned on columns 15 and 17. You can also use the function shuffle_test to return confidence intervals for any estimator. Shuffle_test returns the mean CMI under the null hypothesis (CMI=0), and 95% confidence intervals, estimated using 1000 random permutations of the data.\n*Note that we converted the numpy arrays to lists! The current version really works only on python lists (lists of lists actually, as in the first example.*\n\nSee documentation for references on all implemented estimators.\n\n```latex\n@article{kraskov_estimating_2004,\n    title = {Estimating mutual information},\n    url = {https://link.aps.org/doi/10.1103/PhysRevE.69.066138},\n    doi = {10.1103/PhysRevE.69.066138},\n    journaltitle = {Physical Review E},\n    author = {Kraskov, Alexander and Stögbauer, Harald and Grassberger, Peter},\n    date = {2004-06-23},\n}\n\n@misc{steeg_information-theoretic_2013,\n    title = {Information-Theoretic Measures of Influence Based on Content Dynamics},\n    url = {http://arxiv.org/abs/1208.4475},\n    doi = {10.48550/arXiv.1208.4475},\n    author = {Steeg, Greg Ver and Galstyan, Aram},\n    date = {2013-02-15},\n}\n\n@misc{steeg_information_2011,\n    title = {Information Transfer in Social Media},\n    url = {http://arxiv.org/abs/1110.2724},\n    doi = {10.48550/arXiv.1110.2724},\n    author = {Steeg, Greg Ver and Galstyan, Aram},\n    date = {2011-10-12},\n}%\n```\n\nThe non-parametric estimators actually fare poorly for variables with strong relationships. See the following paper and the improved code available at \u003chttps://github.com/BiuBiuBiLL/NPEET_LNC\u003e\n\n```latex\n@misc{gao_efficient_2015,\n    title = {Efficient Estimation of Mutual Information for Strongly Dependent Variables},\n    url = {http://arxiv.org/abs/1411.2003},\n    doi = {10.48550/arXiv.1411.2003},\n    author = {Gao, Shuyang and Steeg, Greg Ver and Galstyan, Aram},\n    date = {2015-03-05},\n}%\n```\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgregversteeg%2FNPEET","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgregversteeg%2FNPEET","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgregversteeg%2FNPEET/lists"}