{ "info": { "author": "Benjamin Weber", "author_email": "mail@bwe.im", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Customer Service", "Intended Audience :: Developers", "Intended Audience :: Financial and Insurance Industry", "Intended Audience :: Healthcare Industry", "Intended Audience :: Information Technology", "Intended Audience :: Manufacturing", "Intended Audience :: Science/Research", "Intended Audience :: Telecommunications Industry", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5" ], "description": ".. image:: http://ci.appveyor.com/api/projects/status/m0f9fw5b670whkw8?svg=true\n :target: https://ci.appveyor.com/project/hyllos/cause-effect\n\nInstall it\n-----------\n\nYou can install ``cause_effect`` via:\n\n.. code-block:: bash\n\n $ pip install cause_effect\n\nAlternatively, you can install from the code repository directly:\n\n.. code-block:: bash\n\n $ pip install hg+http://bitbucket.org/hyllos/cause_effect\n\nCore Functions\n--------------\n\n``pareto(values)``\n Is a pareto distribution present for a list of numbers (``ratio`` <= 1)?\n\n``mccauses(values)``\n Which causes have the highest concentration (rank * value)?\n\n``mceffects(values)``\n Which effects have the highest concentration?\n\n``separator(values)```\n From which value (including) does the highest concentration begin?\n\n``causes(values, effects=0.8)``\n Determine causes for specified share of effects.\n\n``effects(values, causes=0.2)``\n Determine effects for specified share of causes.\n\nSecondary Functions\n-------------------\n\n``ratio(values)``\n ``entropy`` divided by ``control_limit``.\n\n``entropy(values)``\n Calculate entropy for values.\n\n``control_limit(count)``\n Calculate control entropy for ``count`` number of elements (length of ``values``).\n\nTertiary Functions\n-------------------\n\n``make_causes(count)``\n Return list of causes that is cumulative percent of ``count`` number of elements.\n\n``make_effects(values)``\n Return list of effects that is cumulative percent of values.\n\n``make_concentration(values)``\n Return list of concentration for list of ``values`` that is rank * value.\n\n``sort_list(values)``\n Return sorted list of numbers.\n\nParameters\n-----------\n\n``values`` is a list of numbers.\n``effects`` and ``causes`` must be a number between 0 and 1 (including).\n``count`` is the length of the list of ``values``.\n\nUse it\n------\n\nThe function ``pareto`` tells you whether a pareto distribution is present for a list of numbers:\n\n.. code-block:: python\n\n from pareto import pareto, mccauses, mceffects\n pareto([789, 621, 109, 65, 45, 30, 27, 15, 12, 9])\n True\n\nHere, we have a pareto distribution present.\nThat is a minority causes a majority of effects.\n\nBut which minority causes which majority?\n\n.. code-block:: python\n\n mccauses([789, 621, 109, 65, 45, 30, 27, 15, 12, 9])\n 0.2\n mceffects([789, 621, 109, 65, 45, 30, 27, 15, 12, 9])\n 0.818815331010453\n\n20% of causes effect 82% of results.\n\nBut which values are that 20%?\n\n.. code-block:: python\n\n separator([789, 621, 109, 65, 45, 30, 27, 15, 12, 9])\n 621\n\nAll values greater or equal than 621 are those 20% causing 82% of results.\n\n**That's it.**\n\nDig Deeper\n-----------\n\nHow many causes are required for only 90% of effects?\n\n.. code-block:: python\n\n from pareto import causes, effects\n causes([789, 621, 109, 65, 45, 30, 27, 15, 12, 9], 0.9)\n 0.4\n\n40%.\n\nHow many effects are behind only 10% of causes?\n\n.. code-block:: python\n\n effects([789, 621, 109, 65, 45, 30, 27, 15, 12, 9], 0.1)\n 0.458\n\n45.8%.\n\nHow does it work?\n-----------------\n\n``pareto`` calculates the `entropy`_ for a list of effects:\n\n.. code-block:: python\n\n from pareto import entropy, control_limit, ratio\n entropy([789, 621, 109, 65, 45, 30, 27, 15, 12, 9])\n 1.9593816735406657\n\nIt calculates the entropy for a control group of ten elements. That is the length of our list.\n\n.. code-block:: python\n\n control_limit(10)\n 2.7709505944546686\n\nIt then checks ``entropy`` is less or equal than ``control_limit``.\n\nThis can be simplified to:\n\n.. code-block:: python\n\n values = [789, 621, 109, 65, 45, 30, 27, 15, 12, 9]\n entropy(values) / control_limit(len(values)) <= 1\n\nThe left side of the comparison is done by ``ratio``.\nSo, if you want to find out how nearby or far off you are from a pareto distribution, do:\n\n.. code-block:: python\n\n ratio([109, 65, 45, 30, 27, 15, 12, 9])\n 1.051\n\nIf we remove the first two effects, the ``control_limit`` will be exceeded by the values.\nSo, we learn here that the pareto distribution disappears with the first two effects.\n\n.. _entropy: http://www.boazronen.org/PDF/The%20Pareto%20managerial%20principle%20-%20when%20does%20it%20apply.pdf\n\n``mccauses`` and ``mceffects`` return the respective share of the causes and effects where concentration (rank * value) is highest.\n\n\n=======\nHistory\n=======\n\n0.2.0 (2016-10-21)\n------------------\n\n* Add function separator().\n* Streamline tests.\n\n0.1.0 (2016-10-20)\n------------------\n\n* First release on PyPI.", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://bitbucket.com/hyllos/cause_effect", "keywords": "pareto cause-effect power-law entropy", "license": "MIT license", "maintainer": "", "maintainer_email": "", "name": "cause-effect", "package_url": "https://pypi.org/project/cause-effect/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/cause-effect/", "project_urls": { "Homepage": "http://bitbucket.com/hyllos/cause_effect" }, "release_url": "https://pypi.org/project/cause-effect/0.2.0/", "requires_dist": null, "requires_python": "", "summary": "A library for cause-effect relationships.", "version": "0.2.0" }, "last_serial": 2414108, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "a6fe21abc3531cd55a1c028420522709", "sha256": "8c1c5d6d8cbfaaca2248ec169b0bc4faacefbe16aed01d5acba0fec8eb7ef9dc" }, "downloads": -1, "filename": "cause_effect-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "a6fe21abc3531cd55a1c028420522709", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5280, "upload_time": "2016-10-20T01:09:18", "url": "https://files.pythonhosted.org/packages/46/dc/cdd4f4c71c53c8247eacbd3daca416a8377bbfc0831477d0f157ad8510dd/cause_effect-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ad14e10686726c5a5206fc412becb69e", "sha256": "f7b9c52a3926bf26ce1589e52d7abcc408001dc3fe782e0b70339b25b6d06f3a" }, "downloads": -1, "filename": "cause_effect-0.1.0.tar.gz", "has_sig": false, "md5_digest": "ad14e10686726c5a5206fc412becb69e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5043, "upload_time": "2016-10-20T01:09:21", "url": "https://files.pythonhosted.org/packages/7c/ca/f4356621c7acd5d909f165694985384b08f28ed3eebfe5acd92309ec8441/cause_effect-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "11d9c96c88a1a5d9af75994616114b6c", "sha256": "a05072cb38183c06456a53da078c3064427e63e5920bdc71356dde248236d657" }, "downloads": -1, "filename": "cause_effect-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "11d9c96c88a1a5d9af75994616114b6c", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5483, "upload_time": "2016-10-20T23:20:44", "url": "https://files.pythonhosted.org/packages/cf/ef/bfbb7bb76b2d00bc0c4f3f0703003cfd49f79ff3e3d7b1e8b223c3117319/cause_effect-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4a21e8330c76daa02a558471c14a2b23", "sha256": "6173c9e76c273f1b35694f0deaa533f4aac0ec4faae3e2b943129d75604889a2" }, "downloads": -1, "filename": "cause_effect-0.2.0.tar.gz", "has_sig": false, "md5_digest": "4a21e8330c76daa02a558471c14a2b23", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5196, "upload_time": "2016-10-20T23:20:47", "url": "https://files.pythonhosted.org/packages/12/53/86ded655a10ba8dfe429132ed2b588e760a7d784fdefc226790d4d7c1bec/cause_effect-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "11d9c96c88a1a5d9af75994616114b6c", "sha256": "a05072cb38183c06456a53da078c3064427e63e5920bdc71356dde248236d657" }, "downloads": -1, "filename": "cause_effect-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "11d9c96c88a1a5d9af75994616114b6c", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5483, "upload_time": "2016-10-20T23:20:44", "url": "https://files.pythonhosted.org/packages/cf/ef/bfbb7bb76b2d00bc0c4f3f0703003cfd49f79ff3e3d7b1e8b223c3117319/cause_effect-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4a21e8330c76daa02a558471c14a2b23", "sha256": "6173c9e76c273f1b35694f0deaa533f4aac0ec4faae3e2b943129d75604889a2" }, "downloads": -1, "filename": "cause_effect-0.2.0.tar.gz", "has_sig": false, "md5_digest": "4a21e8330c76daa02a558471c14a2b23", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5196, "upload_time": "2016-10-20T23:20:47", "url": "https://files.pythonhosted.org/packages/12/53/86ded655a10ba8dfe429132ed2b588e760a7d784fdefc226790d4d7c1bec/cause_effect-0.2.0.tar.gz" } ] }