{ "info": { "author": "Esmond Chu", "author_email": "chuhke@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Software Development :: Build Tools" ], "description": "# vdm3\n\nValue difference metric was introduced in 1986 to provide an appropriate distance function for symbolic attributes. It is based on the idea that the goal of finding the distance is to find the right class by looking at the following conditional probabilities.
\n![](./equations/cond_prob.png)
\nThen the distance is calculated by the Euclidean Distance or Manhattan Distance, for instance:
\n![](./equations/distance.png)
\n\n# Install\n\n```\npip install vdm3\n```\n\n## Parameters:\n\n```\nValueDifferenceMetric(X=X, y=y)\n```\n\n - X: ndarray, DataFrame, Series\n - y: tuple, list, ndarray, Series\n\n# Usage\nConsider the following example:
\n```python\n>>> columns = {\n 'Gender':['F','F','F','M','F','F','F','F','M','F'],\n 'Marital':['UN','S','M','M','S','M','M','S','D','M'],\n 'Lead':['REF','INTINT','REF','INTINT','RADIO','REF','INTER','PPC','PPC','RADIO'],\n 'PrevEd':['SOMECOLL','SOMECOLL','ASSOC','BACH','BACH','ASSOC','UN','SOMECOLL','BACH','SOMECOLL'],\n 'Citizen':['US','US','US','US','US','ELNC','US','US','US','US']\n }\n\n>>> X = pd.DataFrame(columns)\n>>> y = np.array([0,0,1,0,0,0,0,0,0,1])\n```\nInitiate the example by:
\n```python\n>>> case = ValueDifferenceMetric(X=X,y=y)\n>>> case.vdm_pairs_fit()\n```\nGet the vdm distance of two points by:\n```python\n>>> point1 = ['F','D','INTER','ASSOC','ELNC']\n>>> point2 = ['M', 'S', 'PPC', 'SOMECOLL', 'US']\n\n>>> case.get_points_distance(point1=point1, point2=point2)\n0.5905636562630361\n```\nReturn 0 if two points are the same:
\n```python\n>>> case.get_points_distance(point1=point1, point2=point1)\n0.0\n```\n\n# Attributes\n - all_pairs\n - all vdm distance pairs from the class instances.\n\n# Methods\n - get_cond_prob(x=x,y=y)\n - return a dictionary contains the conditional probabilities of an input x array and y array.\n - vdm(x=x,y=y)\n - return a dictionary contains all the vdm pairs and the respective conditional probability of an input x array and y array.\n - vdm_pairs_fit()\n - fit vdm with the class instances.\n - get_points_distance(point1=point1,point2=point2)\n - return the distance of two points using the conditional probabilities that learned from the class instances.", "description_content_type": "text/markdown", "docs_url": null, "download_url": "https://github.com/esmondhkchu/vdm3/archive/v_0.1.7.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/esmondhkchu/vdm3", "keywords": "statistics,machine learning,distance", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "vdm3", "package_url": "https://pypi.org/project/vdm3/", "platform": "", "project_url": "https://pypi.org/project/vdm3/", "project_urls": { "Download": "https://github.com/esmondhkchu/vdm3/archive/v_0.1.7.tar.gz", "Homepage": "https://github.com/esmondhkchu/vdm3" }, "release_url": "https://pypi.org/project/vdm3/0.1.7/", "requires_dist": null, "requires_python": "", "summary": "Use Value Difference Metric to find distance between categorical features.", "version": "0.1.7" }, "last_serial": 5219510, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "4ec28b5852daa497f92502e345b4be9a", "sha256": "43588b6a08321a9fdaa1409142283ba2f0789c83194e4d4ad3ac4c2e11a358c7" }, "downloads": -1, "filename": "vdm3-0.1.0.tar.gz", "has_sig": false, "md5_digest": "4ec28b5852daa497f92502e345b4be9a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2295, "upload_time": "2019-04-29T09:58:09", "url": "https://files.pythonhosted.org/packages/42/c3/4d6ed035add41d73ef8e180326e271d53c50062caa9b4c425f5c5a92de38/vdm3-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "683c34e3ee51d447486def41b47bccc1", "sha256": "e3b882ca0ca793c28874b7dc51108694c2347343f20ee2c01d0e2ac25edefa16" }, "downloads": -1, "filename": "vdm3-0.1.1.tar.gz", "has_sig": false, "md5_digest": "683c34e3ee51d447486def41b47bccc1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3105, "upload_time": "2019-04-29T10:34:08", "url": "https://files.pythonhosted.org/packages/69/73/40f9e621f733e2d6f86f0a5b5edf1fd50c786c3c6ad143e96939c9e42e17/vdm3-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "3cb6f57b1f89fad1ae3d2927f22bb9ab", "sha256": "c28f2f5377946fdd94d08caf539c0ffc98132ab7a5e4a3590b5def4ee8586915" }, "downloads": -1, "filename": "vdm3-0.1.2.tar.gz", "has_sig": false, "md5_digest": "3cb6f57b1f89fad1ae3d2927f22bb9ab", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3525, "upload_time": "2019-04-29T11:28:13", "url": "https://files.pythonhosted.org/packages/18/ed/51d9d157a4dd55f3f9beee17ecbb2e2dddb3f1d73dd3a1ef44fb10f862e5/vdm3-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "3bf0614a5f858d32acc38a0d6a30f4ca", "sha256": "0dd2d7c736d5b423b91a76f67a0a4d5ec771857aee45bfab4d43e89e3d820f1f" }, "downloads": -1, "filename": "vdm3-0.1.3.tar.gz", "has_sig": false, "md5_digest": "3bf0614a5f858d32acc38a0d6a30f4ca", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3673, "upload_time": "2019-04-29T12:45:13", "url": "https://files.pythonhosted.org/packages/ba/21/d8bd14a0ecba1c429d28f14e63d9f5901eefa28bbb7c088b6a2fb6220516/vdm3-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "4698242d3a5dd6c78b6291f743588f55", "sha256": "61cf9cd1776605e2e3eb24691537043c0776c740f0dd2b6318c16d2027a14b7e" }, "downloads": -1, "filename": "vdm3-0.1.4.tar.gz", "has_sig": false, "md5_digest": "4698242d3a5dd6c78b6291f743588f55", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3649, "upload_time": "2019-04-30T10:20:03", "url": "https://files.pythonhosted.org/packages/1e/80/1037f4f84de21ebe76d30b6010048e1d65650dc670e6a6e67cf5973a944a/vdm3-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "0cbfcab8e432b6e2edf884f2ec7e631e", "sha256": "028e6c9b402e8bbe453949e8b8834f94742819c39c91cda89ac36ffecb99f97b" }, "downloads": -1, "filename": "vdm3-0.1.5.tar.gz", "has_sig": false, "md5_digest": "0cbfcab8e432b6e2edf884f2ec7e631e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3611, "upload_time": "2019-04-30T12:34:41", "url": "https://files.pythonhosted.org/packages/e6/1c/d72b564f31291fcc300e589c9b22b148cfd73b745840318d9f38924ac15e/vdm3-0.1.5.tar.gz" } ], "0.1.6": [ { "comment_text": "", "digests": { "md5": "888d150bf2a6c44d820f38aaf17d6a12", "sha256": "49c9e22746f44589fc5c8255e47487f7cd7efc937d848f157aa820f36e7bd684" }, "downloads": -1, "filename": "vdm3-0.1.6.tar.gz", "has_sig": false, "md5_digest": "888d150bf2a6c44d820f38aaf17d6a12", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3603, "upload_time": "2019-04-30T13:15:13", "url": "https://files.pythonhosted.org/packages/8f/87/6177f7e0e968430608b9f4814af34e883db6ce382bf44f7d4da716318e41/vdm3-0.1.6.tar.gz" } ], "0.1.7": [ { "comment_text": "", "digests": { "md5": "3033d8f720640079d52ba6eb10729255", "sha256": "966c8746ee2b6b78871f0046ef70c7742065832a990070c45a9063ec68590e8c" }, "downloads": -1, "filename": "vdm3-0.1.7.tar.gz", "has_sig": false, "md5_digest": "3033d8f720640079d52ba6eb10729255", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3621, "upload_time": "2019-05-02T22:10:17", "url": "https://files.pythonhosted.org/packages/52/4d/5f46b20ad512944b81372186d25fdd98613ac9867ea57c44c87ccd18b6eb/vdm3-0.1.7.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3033d8f720640079d52ba6eb10729255", "sha256": "966c8746ee2b6b78871f0046ef70c7742065832a990070c45a9063ec68590e8c" }, "downloads": -1, "filename": "vdm3-0.1.7.tar.gz", "has_sig": false, "md5_digest": "3033d8f720640079d52ba6eb10729255", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3621, "upload_time": "2019-05-02T22:10:17", "url": "https://files.pythonhosted.org/packages/52/4d/5f46b20ad512944b81372186d25fdd98613ac9867ea57c44c87ccd18b6eb/vdm3-0.1.7.tar.gz" } ] }