{ "info": { "author": "Devendra Kumar Sahu", "author_email": "devsahu99@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# Machine Learning Helper\n\nThis package usage multiple algorithms and parameters to accomodate different set of use cases to help in creating multiple machine learning algorithms.\n\n## 1.0 woe (Weight of Evidence):\nThis function will help to calculate Weight of Evidence and Information Value, the charts can be displayed and coarse classing can also be done.\n\n### 1.1 Parameters:\n------------------------------------------------------------\n* **max_bin**: int\n Maximum number of bins for numeric variables. The default is 10\n* **iv_threshold**: float\n Threshold value for Information Value. Variables with higher than threshold will be considered for transformation\n* **ignore_threshold**: Boolean\n This parameter controls whether the defined threshold should be considered or ignored. The default is 'True'\n\n------------------------------------------------------------\n### 1.2 Returns:\nDataFrame having weight of evidence of each column along with the target variable\n\n\n------------------------------------------------------------\n### 1.3 Approach:\n\n1. Create an instance of woe\n my_woe = woe()\n\n2. Call fit method on the defined object by passing on dataframe and the target variable name\n my_woe.fit(df,target)\n\n3. Call the transform method\n transformed_df = my_woe.transform()\n\n------------------------------------------------------------\n## Example\n\n### Create Sample DataFrame\n```python\nfrom mlh import woe\nimport pandas as pd\nimport numpy as np\nimport random\n\nseed=1456\nnp.random.seed(seed)\nrandom.seed(seed)\n```\n```python\nrows = 1000\n```\n```python\ny = random.choices([0,1],k=rows,weights=[.7,.3])\n```\n```python\nx1 = random.choices(np.arange(20,40),k=rows)\nx2 = np.random.randint(1000,2000,size=rows)\nx3 = random.choices(np.arange(1,100),k=rows)\nx4 = random.choices(['m','f','u'],k=rows)\nx5 = random.choices(['a','b','c','d','e','f','g','h'],k=rows)\n```\n```python\ndf = pd.DataFrame({'y':y,'x1':x1,'x2':x2,'x3':x3,'x4':x4,'x5':x5})\n```\n```python\ndf.head()\n```\n### Fitting and prediction\n\n**Create Instance of Weight of Evidence Package**\n```python\nmy_woe = woe()\n```\n**Fit the data with created instance**\n```python\nmy_woe.fit(df,'y')\n```\n**Display the relevant charts**\n```python\nmy_woe.getWoeCharts()\n```\n**Merge values of X3 Variable at 1 and 2 indices using the Weight of Evidence chart from the first Iteration**\n```python\nmy_woe.reset_woe(2,(1,2),1)\n```\n**Get latest Iteration Information Value**\n```python\nmy_woe.get_IV()\n```\n**Replace the original values in the Dataframe with Weight of Evidence**\n```python\ntransformed_df = my_woe.transform()\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/devsahu99/mlh", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "mlh", "package_url": "https://pypi.org/project/mlh/", "platform": "", "project_url": "https://pypi.org/project/mlh/", "project_urls": { "Homepage": "https://github.com/devsahu99/mlh" }, "release_url": "https://pypi.org/project/mlh/0.0.2/", "requires_dist": [ "pandas", "scipy", "IPython", "matplotlib", "scikit-plot", "sklearn", "openpyxl" ], "requires_python": "", "summary": "This package provides helper utilities for machine learning tasks. One major utility is calculation of weight of evidence", "version": "0.0.2" }, "last_serial": 4909825, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "8ea2436586ee90a4802a297242b71d6f", "sha256": "709803b2caefc30b5d21c16d086b5350b03563eb0fc5fc071ee46ce61e2148bb" }, "downloads": -1, "filename": "mlh-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "8ea2436586ee90a4802a297242b71d6f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7014, "upload_time": "2019-03-05T10:58:07", "url": "https://files.pythonhosted.org/packages/f8/0d/4ec3333ca1fd258a7aa9dce47856ceae3a2a42a14294171db113bd3d20fc/mlh-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9f03913928c48069e4aa9c34d43cd89e", "sha256": "861ada808b6a64b25ff018e71f24969668ed9feeb811fd063e2fcc8d5d7c3957" }, "downloads": -1, "filename": "mlh-0.0.1.tar.gz", "has_sig": false, "md5_digest": "9f03913928c48069e4aa9c34d43cd89e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6270, "upload_time": "2019-03-05T10:58:10", "url": "https://files.pythonhosted.org/packages/8d/d7/68b2d4c7306b1381b607f6ef9e41b4827bb5b807f3157df0f4512bcae1d1/mlh-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "052942025cd3669f81c9371085a673fb", "sha256": "288c656164abbe31e65419cb984d31d696d564bc0f02452ce49e779cdbfb618d" }, "downloads": -1, "filename": "mlh-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "052942025cd3669f81c9371085a673fb", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11960, "upload_time": "2019-03-07T11:54:48", "url": "https://files.pythonhosted.org/packages/05/9f/76abeba665320fc4a20e9efa845fe36406115f9a561123f9e7c2aab22611/mlh-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9aa2325ae8e20c03f36933ead887d013", "sha256": "69046db746fce3c19b91e1a90a1f478c277defb56c8e88b211d008b1f3874747" }, "downloads": -1, "filename": "mlh-0.0.2.tar.gz", "has_sig": false, "md5_digest": "9aa2325ae8e20c03f36933ead887d013", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10606, "upload_time": "2019-03-07T11:54:49", "url": "https://files.pythonhosted.org/packages/1e/2b/be56e799cb2585ebf9b3f5290fdd810a354f3e9b402a1d7ad58cba44afa4/mlh-0.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "052942025cd3669f81c9371085a673fb", "sha256": "288c656164abbe31e65419cb984d31d696d564bc0f02452ce49e779cdbfb618d" }, "downloads": -1, "filename": "mlh-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "052942025cd3669f81c9371085a673fb", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11960, "upload_time": "2019-03-07T11:54:48", "url": "https://files.pythonhosted.org/packages/05/9f/76abeba665320fc4a20e9efa845fe36406115f9a561123f9e7c2aab22611/mlh-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9aa2325ae8e20c03f36933ead887d013", "sha256": "69046db746fce3c19b91e1a90a1f478c277defb56c8e88b211d008b1f3874747" }, "downloads": -1, "filename": "mlh-0.0.2.tar.gz", "has_sig": false, "md5_digest": "9aa2325ae8e20c03f36933ead887d013", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10606, "upload_time": "2019-03-07T11:54:49", "url": "https://files.pythonhosted.org/packages/1e/2b/be56e799cb2585ebf9b3f5290fdd810a354f3e9b402a1d7ad58cba44afa4/mlh-0.0.2.tar.gz" } ] }