{"id":18376352,"url":"https://github.com/fmind/ouroboros","last_synced_at":"2025-04-11T04:43:22.588Z","repository":{"id":101908198,"uuid":"175448313","full_name":"fmind/ouroboros","owner":"fmind","description":" Implementation of the Ouroboros index: a size-independent diversity statistic","archived":false,"fork":false,"pushed_at":"2019-07-04T08:54:24.000Z","size":169,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-11T04:43:19.510Z","etag":null,"topics":["diversity","index","metrics","python","statistics"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fmind.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2019-03-13T15:26:41.000Z","updated_at":"2019-07-04T08:54:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"0ad38066-c2eb-42f7-b60f-b6abdb30c8c5","html_url":"https://github.com/fmind/ouroboros","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/fmind%2Fouroboros","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fmind%2Fouroboros/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fmind%2Fouroboros/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fmind%2Fouroboros/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fmind","download_url":"https://codeload.github.com/fmind/ouroboros/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248345281,"owners_count":21088242,"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":["diversity","index","metrics","python","statistics"],"created_at":"2024-11-06T00:22:59.703Z","updated_at":"2025-04-11T04:43:22.571Z","avatar_url":"https://github.com/fmind.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# What is Ouroboros ?\n\n_Ouroboros_ is a function which measures the uniformity of a list of frequencies, independently of the size of the list.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"ouroboros.gif\"/\u003e\n\u003c/p\u003e\n\n__Input__:\n* an array of frequencies (counts or proportions values) \n\n__Output__:\n* Index: quantifies the uniformity of a list in an unitless scale (0 for min. uniformity, 1 for max. uniformity)\n* Indice (option): the minimal number of groups that includes at least 50\\% of the individuals (between 0 and N/2)\n\n__Interpretation__:\n* Index: twice the minimum percentage of values to include in order to reach 50% of individuals\n* Index/2: the minimal proportion of groups which includes 50% of individuals\n\n__Example__:\n\nIndividuals are evenly distributed among groups: Index = 1, Indice = 3\n\n![Individuals are evenly distributed among groups: Index = 1, Indice = 3](example/uniform.png)\n\nIndividuals are distributed in 1 group: Index = 0, Indice=1\n\n![Individuals are distributed in 1 group - Index = 0, Indice=1](example/not-uniform.png)\n\n# How does Ouroboros work ?\n\nA technical implementation of the function is provided in _ouroboros.py_.\n\n__Pseudo-code (high-level)__:\n- sort the list of frequencies in descending order\n- accumulate values from the head until 50% individuals are included\n- smooth values depending on the final percentage of individuals accumulated\n- return the Index (and optionally the Indice) of the list\n\n# Why is Ouroboros different ?\n\n__Compared to the [median](https://en.wikipedia.org/wiki/Median)__, _Ouroboros_\ndoes not cut a list of values in two lists of equal sizes. Instead, the function\nfinds the minimal number of values to sum in order to reach 50% of the distribution. \n\n__Compared to a\n[Pearson's chi-squared test](https://en.wikipedia.org/wiki/Pearson%27s_chi-squared_test#Discrete_uniform_distribution)__,\n_Ouroboros_ is not a statistic test value. Thus, _Ouroboros_ is simpler to compute and to interpret.\n\n__Compared to\n[Diversity indexes](https://en.wikipedia.org/wiki/Diversity_index)__, _Ouroboros_\nreturns percentage values instead of squared values (Gini-Simpson index) or\nlogarithmic values (Shannon index). This choice makes the function easier to\ninterpret since the scale is linear. In addition,\n_Ouroboros_ will always returns an index of 0 or 1 for the two most extremes cases.\n\nARRAY           | OURO | GINI\n----------------|------|-----\n100             | 1.00 | 0.00\n100,0           | 0.00 | 0.00\n75,25           | 0.50 | 0.38\n60,40           | 0.80 | 0.48\n50,50           | 1.00 | 0.50\n100,0,0         | 0.00 | 0.00\n90,5,5          | 0.15 | 0.19\n67,23,10        | 0.49 | 0.49\n65,35,0         | 0.52 | 0.45\n50,30,20        | 0.75 | 0.62\n34,33,33        | 0.99 | 0.67\n100,0,0,0       | 0.00 | 0.00\n80,20,0,0       | 0.20 | 0.32\n60,20,10,10     | 0.40 | 0.58\n40,40,10,10     | 0.70 | 0.66\n49,49,1,1       | 0.52 | 0.52\n30,30,20,20     | 0.90 | 0.74\n25,25,25,25     | 1.00 | 0.75\n100,0,0,0,0     | 0.00 | 0.00\n80,20,0,0,0     | 0.17 | 0.32\n50,30,10,10,0   | 0.42 | 0.64\n30,25,20,20,5   | 0.71 | 0.77\n25,25,25,15,10  | 0.75 | 0.78\n25,20,20,20,15  | 0.96 | 0.79\n20,20,20,20,20  | 1.00 | 0.80\n\n# FAQ\n\n### Why the name of the function is Ouroboros ?\n\nHeads and tails of statistic distributions are characteristic elements that can be used to measure equalities.\n\n_Ouroboros_ is the \"tail-devouring snake\", which describes where \"the head bites the tail of a distribution\".\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffmind%2Fouroboros","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffmind%2Fouroboros","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffmind%2Fouroboros/lists"}