{ "info": { "author": "Krzysztof Chalupka", "author_email": "janchatko@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Scientific/Engineering :: Artificial Intelligence" ], "description": ".. image:: https://img.shields.io/badge/License-MIT-yellow.svg\n :target: https://opensource.org/licenses/MIT\n :alt: License\n\n*A Fast Conditional Independence Test (FCIT).*\n\nIntroduction\n-----------\nLet *x, y, z* be random variables. Then deciding whether *P(y | x, z) = P(y | z)* \ncan be difficult, especially if the variables are continuous. This package \nimplements a simple yet efficient and effective conditional independence test,\ndescribed in [link to arXiv when we write it up!]. Important features that differentiate\nthis test from competition:\n\n* It is fast. Worst-case speed scales as O(n_data * log(n_data) * dim), where dim is max(x_dim + z_dim, y_dim). However, amortized speed is O(n_data * log(n_data) * log(dim)).\n\n* It applies to cases where some of x, y, z are continuous and some are discrete, or categorical (one-hot-encoded).\n\n* It is very simple to understand and modify.\n\n* It can be used for unconditional independence testing with almost no changes to the procedure.\n\nWe have applied this test to tens of thousands of samples of thousand-dimensional datapoints in seconds. For smaller dimensionalities and sample sizes, it takes a fraction of a second. The algorithm is described in [arXiv link coming], where we also provide detailed experimental results and comparison with other methods. However for now, you should be able to just look through the code to understand what's going on -- it's only 90 lines of Python, including detailed comments!\n\nUsage\n-----\nBasic usage is simple, and the default settings should work in most cases. To perform an *unconditional test*, use dtit.test(x, y):\n\n.. code:: python\n\n import numpy as np\n from fcit import fcit\n\n x = np.random.rand(1000, 1)\n y = np.random.randn(1000, 1)\n\n pval_i = fcit.test(x, y) # p-value should be uniform on [0, 1].\n pval_d = fcit.test(x, x + y) # p-value should be very small.\n\nTo perform a conditional test, just add the third variable z to the inputs:\n\n.. code:: python\n\n import numpy as np\n from fcit import fcit\n\n # Generate some data such that x is indpendent of y given z.\n n_samples = 1000\n z = np.random.dirichlet(alpha=np.ones(2), size=n_samples)\n x = np.vstack([np.random.multinomial(20, p) for p in z]).astype(float)\n y = np.vstack([np.random.multinomial(20, p) for p in z]).astype(float)\n\n # Check that x and y are dependent (p-value should be uniform on [0, 1]).\n pval_d = fcit.test(x, y)\n # Check that z d-separates x and y (the p-value should be small).\n pval_i = fcit.test(x, y, z)\n\nInstallation\n-----------\npip install fcit\n\n\nRequirements\n------------\nTested with Python 3.6 and\n\n * joblib >= 0.11\n * numpy >= 1.12\n * scikit-learn >= 0.18.1\n * scipy >= 0.16.1\n\n.. _pip: http://www.pip-installer.org/en/latest/\n\n\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/kjchalup/fcit", "keywords": "machine learning statistics decision trees", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "fcit", "package_url": "https://pypi.org/project/fcit/", "platform": "", "project_url": "https://pypi.org/project/fcit/", "project_urls": { "Homepage": "https://github.com/kjchalup/fcit" }, "release_url": "https://pypi.org/project/fcit/1.2.0/", "requires_dist": [ "numpy", "sklearn", "scipy", "joblib" ], "requires_python": "", "summary": "A decision-tree based conditional independence test", "version": "1.2.0" }, "last_serial": 3454621, "releases": { "1.2.0": [ { "comment_text": "", "digests": { "md5": "4db9f6eeac8d34df9deb68dfe4a5dc9c", "sha256": "9d6d172e92a770d86060e49c3c4f2c063dcf098b202edbd1e5dbdaeadd672f52" }, "downloads": -1, "filename": "fcit-1.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "4db9f6eeac8d34df9deb68dfe4a5dc9c", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7607, "upload_time": "2018-01-01T15:35:16", "url": "https://files.pythonhosted.org/packages/0f/9e/49b831916a2c6fe1804ce1df7c47885c631704883e4b805af25e21f0a599/fcit-1.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e595d0c59ecd4da6dbf354124ebe0263", "sha256": "076b0e752fb5f017544cbd888c447efeaab6db0622aa93a8afe9cee6c73c1a25" }, "downloads": -1, "filename": "fcit-1.2.0.tar.gz", "has_sig": false, "md5_digest": "e595d0c59ecd4da6dbf354124ebe0263", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5837, "upload_time": "2018-01-01T15:35:18", "url": "https://files.pythonhosted.org/packages/87/fd/78c4fe9636b474143c3126e502c550712809f6df8f81e40289cd44956b93/fcit-1.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "4db9f6eeac8d34df9deb68dfe4a5dc9c", "sha256": "9d6d172e92a770d86060e49c3c4f2c063dcf098b202edbd1e5dbdaeadd672f52" }, "downloads": -1, "filename": "fcit-1.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "4db9f6eeac8d34df9deb68dfe4a5dc9c", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7607, "upload_time": "2018-01-01T15:35:16", "url": "https://files.pythonhosted.org/packages/0f/9e/49b831916a2c6fe1804ce1df7c47885c631704883e4b805af25e21f0a599/fcit-1.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e595d0c59ecd4da6dbf354124ebe0263", "sha256": "076b0e752fb5f017544cbd888c447efeaab6db0622aa93a8afe9cee6c73c1a25" }, "downloads": -1, "filename": "fcit-1.2.0.tar.gz", "has_sig": false, "md5_digest": "e595d0c59ecd4da6dbf354124ebe0263", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5837, "upload_time": "2018-01-01T15:35:18", "url": "https://files.pythonhosted.org/packages/87/fd/78c4fe9636b474143c3126e502c550712809f6df8f81e40289cd44956b93/fcit-1.2.0.tar.gz" } ] }