{ "info": { "author": "Thijs van Ede", "author_email": "t.s.vanede@utwente.nl", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# info_gain\nImplementation of information gain algorithm. There seems to be a debate about how the information gain metric is defined. Whether to use the [Kullback-Leibler divergence](https://en.wikipedia.org/wiki/Kullback%E2%80%93Leibler_divergence) or the [Mutual information](https://en.wikipedia.org/wiki/Mutual_information) as an algorithm to define information gain. This implementation uses the [information gain calculation](https://en.wikipedia.org/wiki/Information_gain_ratio) as defined below:\n\n## Information gain definitions\n### Information gain calculation\nDefinition from [information gain calculation](https://en.wikipedia.org/wiki/Information_gain_ratio) (retrieved 2018-07-13).\nLet `Attr` be the set of all attributes and `Ex` the set of all training examples, `value(x, a)` with `x` in `Ex` defines the value of a specific example `x` for attribute `a` in `Attr`, `H` specifies the entropy. The `values(a)` function denotes the set of all possible values of attribute `a` in `Attr`. The information gain for an attribute `a` in `Attr` is defined as follows:\n\n![Information gain formula][ig]\n\n[ig]: https://github.com/Thijsvanede/info_gain/blob/master/images/information_gain_formula.gif\n\n### Intrinsic value calculation\nDefinition from [information gain calculation](https://en.wikipedia.org/wiki/Information_gain_ratio) (retrieved 2018-07-13).\n\n![Intrinsic value calculation][iv]\n\n[iv]: https://github.com/Thijsvanede/info_gain/blob/master/images/intrinsic_value_formula.gif\n\n### Information gain ratio calculation\nDefinition from [information gain calculation](https://en.wikipedia.org/wiki/Information_gain_ratio) (retrieved 2018-07-13).\n\n![Intrinsic value calculation][igr]\n\n[igr]: https://github.com/Thijsvanede/info_gain/blob/master/images/information_gain_ratio_formula.gif\n\n## Installation\nTo install the package via pip use:\n```\npip install info_gain\n```\n\nTo clone the package from the git repository use:\n```\ngit clone https://github.com/Thijsvanede/info_gain.git\n```\n\n## Usage\nImport the `info_gain` module with:\n```\nfrom info_gain import info_gain\n```\nThe imported module has supports three methods:\n * `info_gain.info_gain(Ex, a)` to compute the information gain.\n * `info_gain.intrinsic_value(Ex, a)` to compute the intrinsic value.\n * `info_gain.info_gain_ratio(Ex, a)` to compute the information gain ratio.\n\n### Example\n```python\nfrom info_gain import info_gain\n\n# Example of color to indicate whether something is fruit or vegatable\nproduce = ['apple', 'apple', 'apple', 'strawberry', 'eggplant']\nfruit = [ True , True , True , True , False ]\ncolour = ['green', 'green', 'red' , 'red' , 'purple' ]\n\nig = info_gain.info_gain(fruit, colour)\niv = info_gain.intrinsic_value(fruit, colour)\nigr = info_gain.info_gain_ratio(fruit, colour)\n\nprint(ig, iv, igr)\n```\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Thijsvanede/info_gain", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "info-gain", "package_url": "https://pypi.org/project/info-gain/", "platform": "", "project_url": "https://pypi.org/project/info-gain/", "project_urls": { "Homepage": "https://github.com/Thijsvanede/info_gain" }, "release_url": "https://pypi.org/project/info-gain/1.0.1/", "requires_dist": null, "requires_python": "", "summary": "Information gain utilities", "version": "1.0.1" }, "last_serial": 4064994, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "97647a23268df5d1ca4ce41343ff0d1f", "sha256": "5109869e2c95aff60a35fdc64d41164b7e7d27027a5184f762bbcdf117e65a92" }, "downloads": -1, "filename": "info_gain-1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "97647a23268df5d1ca4ce41343ff0d1f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3009, "upload_time": "2018-07-13T14:24:34", "url": "https://files.pythonhosted.org/packages/53/82/cfb0a2c9c15cbee52cb10e6f4ea778947f01cc487ca84d7351b20f8318c2/info_gain-1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "54de41770272303f0e74f7d223fd5eda", "sha256": "3e8b28f552a6223c68e00ac3cf7fd6368cff6470911ae86d7415d6dc08939bb7" }, "downloads": -1, "filename": "info_gain-1.0.tar.gz", "has_sig": false, "md5_digest": "54de41770272303f0e74f7d223fd5eda", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2703, "upload_time": "2018-07-13T14:24:35", "url": "https://files.pythonhosted.org/packages/5b/45/68aabe58688ed41c8ad719b53b6659bf0b0ce03790b1872f018dc0c7e026/info_gain-1.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "553b84fa4ff15d146b21fa46d3491510", "sha256": "a4f1916be4b0eb51a2389f583fc0490b240e867aadf76dbd2898462270f2be9e" }, "downloads": -1, "filename": "info_gain-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "553b84fa4ff15d146b21fa46d3491510", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3290, "upload_time": "2018-07-16T09:00:51", "url": "https://files.pythonhosted.org/packages/41/53/198b263ac9fef93095d21a315007234aff4061132fa95f802ac32c7bfff9/info_gain-1.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "81965db77e37d4a9d181a3a9ba47836f", "sha256": "e8159d09c58e7302507cea9ebc8e6b1c04310e7f9b30a99f831554d4f772e9c1" }, "downloads": -1, "filename": "info_gain-1.0.1.tar.gz", "has_sig": false, "md5_digest": "81965db77e37d4a9d181a3a9ba47836f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2977, "upload_time": "2018-07-16T09:00:52", "url": "https://files.pythonhosted.org/packages/74/da/b7ac47b517b47ca3f0bcf87a8ed3f17c2b1978c4df9f000e0ac577b2106e/info_gain-1.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "553b84fa4ff15d146b21fa46d3491510", "sha256": "a4f1916be4b0eb51a2389f583fc0490b240e867aadf76dbd2898462270f2be9e" }, "downloads": -1, "filename": "info_gain-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "553b84fa4ff15d146b21fa46d3491510", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3290, "upload_time": "2018-07-16T09:00:51", "url": "https://files.pythonhosted.org/packages/41/53/198b263ac9fef93095d21a315007234aff4061132fa95f802ac32c7bfff9/info_gain-1.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "81965db77e37d4a9d181a3a9ba47836f", "sha256": "e8159d09c58e7302507cea9ebc8e6b1c04310e7f9b30a99f831554d4f772e9c1" }, "downloads": -1, "filename": "info_gain-1.0.1.tar.gz", "has_sig": false, "md5_digest": "81965db77e37d4a9d181a3a9ba47836f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2977, "upload_time": "2018-07-16T09:00:52", "url": "https://files.pythonhosted.org/packages/74/da/b7ac47b517b47ca3f0bcf87a8ed3f17c2b1978c4df9f000e0ac577b2106e/info_gain-1.0.1.tar.gz" } ] }