{ "info": { "author": "Daniel Homola", "author_email": "dani.homola@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "# boruta_py #\n\nThis project hosts Python implementations of the [Boruta all-relevant feature selection method](https://m2.icm.edu.pl/boruta/).\n\n[Related blog post] (http://danielhomola.com/2015/05/08/borutapy-an-all-relevant-feature-selection-method/)\n\n## Dependencies ##\n\n* numpy\n* scipy\n* scikit-learn\n\n## How to use ##\nDownload, import and do as you would with any other scikit-learn method:\n* fit(X, y)\n* transform(X)\n* fit_transform(X, y)\n\n## Description ##\n\nPython implementations of the Boruta R package.\n\nThis implementation tries to mimic the scikit-learn interface, so use fit,\ntransform or fit_transform, to run the feature selection.\n\nFor more, see the docs of these functions, and the examples below.\n\nOriginal code and method by: Miron B Kursa, https://m2.icm.edu.pl/boruta/\n\nBoruta is an all relevant feature selection method, while most other are\nminimal optimal; this means it tries to find all features carrying\ninformation usable for prediction, rather than finding a possibly compact\nsubset of features on which some classifier has a minimal error.\n\nWhy bother with all relevant feature selection?\nWhen you try to understand the phenomenon that made your data, you should\ncare about all factors that contribute to it, not just the bluntest signs\nof it in context of your methodology (yes, minimal optimal set of features\nby definition depends on your classifier choice).\n\n\n## What's different in BorutaPy? ##\n\nIt is the original R package recoded in Python with a few added extra features.\nSome improvements include: \n\n* Faster run times, thanks to scikit-learn\n\n* Scikit-learn like interface\n\n* Compatible with any ensemble method from scikit-learn\n\n* Automatic n_estimator selection\n\n* Ranking of features\n\nFor more details, please check the top of the docstring.\n\nWe highly recommend using pruned trees with a depth between 3-7.\n\nAlso, after playing around a lot with the original code I identified a few areas\nwhere the core algorithm could be improved/altered to make it less strict and\nmore applicable to biological data, where the Bonferroni correction might be\noverly harsh.\n\n__Percentile as threshold__ \nThe original method uses the maximum of the shadow features as a threshold in\ndeciding which real feature is doing better than the shadow ones. This could be\noverly harsh.\n\nTo control this, I added the perc parameter, which sets the\npercentile of the shadow features' importances, the algorithm uses as the\nthreshold. The default of 100 which is equivalent to taking the maximum as the\nR version of Boruta does, but it could be relaxed. Note, since this is the\npercentile, it changes with the size of the dataset. With several thousands of\nfeatures it isn't as stringent as with a few dozens at the end of a Boruta run.\n\n\n__Two step correction for multiple testing__ \nThe correction for multiple testing was relaxed by making it a two step\nprocess, rather than a harsh one step Bonferroni correction.\n\nWe need to correct firstly because in each iteration we test a number of\nfeatures against the null hypothesis (does a feature perform better than\nexpected by random). For this the Bonferroni correction is used in the original\ncode which is known to be too stringent in such scenarios (at least for\nbiological data), and also the original code corrects for n features, even if\nwe are in the 50th iteration where we only have k< A supervised learning estimator, with a 'fit' method that returns the\n > feature_importances_ attribute. Important features must correspond to\n > high absolute values in the feature_importances_.\n\n__n_estimators__ : int or string, default = 1000\n > If int sets the number of estimators in the chosen ensemble method.\n > If 'auto' this is determined automatically based on the size of the\n > dataset. The other parameters of the used estimators need to be set\n > with initialisation.\n\n__perc__ : int, default = 100\n > Instead of the max we use the percentile defined by the user, to pick\n > our threshold for comparison between shadow and real features. The max\n > tend to be too stringent. This provides a finer control over this. The\n > lower perc is the more false positives will be picked as relevant but\n > also the less relevant features will be left out. The usual trade-off.\n > The default is essentially the vanilla Boruta corresponding to the max.\n\n__alpha__ : float, default = 0.05\n > Level at which the corrected p-values will get rejected in both correction\n steps.\n\n__two_step__ : Boolean, default = True\n > If you want to use the original implementation of Boruta with Bonferroni\n > correction only set this to False.\n\n__max_iter__ : int, default = 100\n > The number of maximum iterations to perform.\n\n__verbose__ : int, default=0\n > Controls verbosity of output.\n\n\n## Attributes ##\n\n**n_features_** : int\n > The number of selected features.\n\n**support_** : array of shape [n_features]\n > The mask of selected features - only confirmed ones are True.\n\n**support_weak_** : array of shape [n_features]\n > The mask of selected tentative features, which haven't gained enough\n > support during the max_iter number of iterations..\n\n**ranking_** : array of shape [n_features]\n > The feature ranking, such that ``ranking_[i]`` corresponds to the\n > ranking position of the i-th feature. Selected (i.e., estimated\n > best) features are assigned rank 1 and tentative features are assigned\n > rank 2.\n\n\n## Examples ##\n\n import pandas as pd\n from sklearn.ensemble import RandomForestClassifier\n from boruta import BorutaPy\n\n # load X and y\n # NOTE BorutaPy accepts numpy arrays only, hence the .values attribute\n X = pd.read_csv('examples/test_X.csv', index_col=0).values\n y = pd.read_csv('examples/test_y.csv', header=None, index_col=0).values\n y = y.ravel()\n\n # define random forest classifier, with utilising all cores and\n # sampling in proportion to y labels\n rf = RandomForestClassifier(n_jobs=-1, class_weight='balanced', max_depth=5)\n\n # define Boruta feature selection method\n feat_selector = BorutaPy(rf, n_estimators='auto', verbose=2, random_state=1)\n\n # find all relevant features - 5 features should be selected\n feat_selector.fit(X, y)\n\n # check selected features - first 5 features are selected\n feat_selector.support_\n\n # check ranking of features\n feat_selector.ranking_\n\n # call transform() on X to filter it down to selected features\n X_filtered = feat_selector.transform(X)\n\n## References ##\n\n1. Kursa M., Rudnicki W., \"Feature Selection with the Boruta Package\" Journal of Statistical Software, Vol. 36, Issue 11, Sep 2010\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/danielhomola/boruta_py", "keywords": "feature selection,machine learning,random forest", "license": "BSD 3 clause", "maintainer": "", "maintainer_email": "", "name": "Boruta", "package_url": "https://pypi.org/project/Boruta/", "platform": "", "project_url": "https://pypi.org/project/Boruta/", "project_urls": { "Homepage": "https://github.com/danielhomola/boruta_py" }, "release_url": "https://pypi.org/project/Boruta/0.3/", "requires_dist": [ "numpy (>=1.10.4)", "scikit-learn (>=0.17.1)", "scipy (>=0.17.0)" ], "requires_python": "", "summary": "Python Implementation of Boruta Feature Selection", "version": "0.3" }, "last_serial": 5290843, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "519df7c7990ea6c99b4538915dea6051", "sha256": "3b4882cf492e4fe7672ccedbdcd6d9bbb0fb3f5cf78ef4c4b036b0e84f3c164f" }, "downloads": -1, "filename": "Boruta-0.1.1.tar.gz", "has_sig": false, "md5_digest": "519df7c7990ea6c99b4538915dea6051", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7436, "upload_time": "2017-01-15T13:29:37", "url": "https://files.pythonhosted.org/packages/df/7c/0b683c79de8bc9e7fb773bea84d4b4442e1cf24da8bab272b0ddb2e4470b/Boruta-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "d5981aa88f91d0bcac725d4076be5981", "sha256": "565a8485d2c1d2de069794fadaee5b7077cf066c40c8971e5228359648d28560" }, "downloads": -1, "filename": "Boruta-0.1.2.tar.gz", "has_sig": false, "md5_digest": "d5981aa88f91d0bcac725d4076be5981", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10772, "upload_time": "2017-01-15T18:00:53", "url": "https://files.pythonhosted.org/packages/37/85/8517e19e5503ad6e5ab34d8f9c677c8e42ea3b204439c66456c331c9fbb7/Boruta-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "dec3549cb0b52db3c251c43b464ef8ca", "sha256": "27b5af3b6166c6f577d1233314fef7ac56b8a06f12b7fe222b785585b087f124" }, "downloads": -1, "filename": "Boruta-0.1.3.tar.gz", "has_sig": false, "md5_digest": "dec3549cb0b52db3c251c43b464ef8ca", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8876, "upload_time": "2017-01-15T18:24:16", "url": "https://files.pythonhosted.org/packages/17/47/03fe93e8de73534ab839f5953d185136c53ba727cb549ba3aa8f5a5f83f2/Boruta-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "deda419e5b1d53e3c9753f5d4f71f447", "sha256": "ccfefc21f1816ee737bee1a3d409fac661aaba1588bb29621b7b096f3841cd85" }, "downloads": -1, "filename": "Boruta-0.1.4.tar.gz", "has_sig": false, "md5_digest": "deda419e5b1d53e3c9753f5d4f71f447", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8940, "upload_time": "2017-03-05T12:03:50", "url": "https://files.pythonhosted.org/packages/88/aa/5951a8bab03642ce1c468cecb770ee34bfdbd13a6fd8865f11c64acfd943/Boruta-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "3933616763f95aca1532b21146d0735f", "sha256": "02170d5425cf4aeef2af378bd301f330427fbdae4720c5585073200ca41fb4fc" }, "downloads": -1, "filename": "Boruta-0.1.5.tar.gz", "has_sig": false, "md5_digest": "3933616763f95aca1532b21146d0735f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 55829, "upload_time": "2017-03-05T12:21:54", "url": "https://files.pythonhosted.org/packages/35/03/ca2b7e352bf1f0e2dd0e17e1b8c92f75dbb9f218d36eba4e894efa2a0478/Boruta-0.1.5.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "0e19cca18f9bcef25dd2f38ee4456da9", "sha256": "28729ee194658bc1ea09cb6024bf1d1a24873be1e19bdaefe4d79a1daa1b32a9" }, "downloads": -1, "filename": "Boruta-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "0e19cca18f9bcef25dd2f38ee4456da9", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 53592, "upload_time": "2019-05-19T17:33:51", "url": "https://files.pythonhosted.org/packages/e9/07/776f7aa3c606d68b4c1f297c842531dd70bc3a5a4cc9b9616f20238cde44/Boruta-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "191c5314747b075f7ab0740f5f4446bf", "sha256": "cede04ab25eaa536abc2a79cb2d06d0ea2fcd1f2c0a0240c65a12a7fb35d438c" }, "downloads": -1, "filename": "Boruta-0.2.0.tar.gz", "has_sig": false, "md5_digest": "191c5314747b075f7ab0740f5f4446bf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 55681, "upload_time": "2019-05-19T17:23:53", "url": "https://files.pythonhosted.org/packages/27/e4/d5c810d08220c1fb774a88ad204a107d2b05ce157f54cced59e0fb3ddd95/Boruta-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "cc7b1ed195d06738ee363649dcf03a8f", "sha256": "42c7a3546220cacb6696971f0e898a931f4f5bf322a4a6ea5ebe0968cbb6388f" }, "downloads": -1, "filename": "Boruta-0.2.1-py3-none-any.whl", "has_sig": false, "md5_digest": "cc7b1ed195d06738ee363649dcf03a8f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 53641, "upload_time": "2019-05-19T17:33:52", "url": "https://files.pythonhosted.org/packages/29/ce/d3a240edfad5622e62cc2b47d9f8a6a3b6508b8e4b4a952e6eeae86c381f/Boruta-0.2.1-py3-none-any.whl" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "a29c796fde9e3dde38fa7873f44b7b33", "sha256": "53b03330ecfa26f8df63eacad9780f4fadd9b9ed4587b2b2d850f1266449bd5c" }, "downloads": -1, "filename": "Boruta-0.2.2-py3-none-any.whl", "has_sig": false, "md5_digest": "a29c796fde9e3dde38fa7873f44b7b33", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 56655, "upload_time": "2019-05-20T07:44:36", "url": "https://files.pythonhosted.org/packages/32/e4/4f5c397ba92bb5577ba61727f023669303fa2138d5a3b5c9a51eddb889af/Boruta-0.2.2-py3-none-any.whl" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "a5d6038894ecd8017ad6cb61535d0ddc", "sha256": "8269e9c152ae73ed05cd2b347b6b53edc437e1f7b6e1f3d6b8bee1e99d27e963" }, "downloads": -1, "filename": "Boruta-0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "a5d6038894ecd8017ad6cb61535d0ddc", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 56630, "upload_time": "2019-05-20T07:46:58", "url": "https://files.pythonhosted.org/packages/b2/11/583f4eac99d802c79af9217e1eff56027742a69e6c866b295cce6a5a8fc2/Boruta-0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1d804dccc34427afd007bc0f2fcc630e", "sha256": "06d42882a57a4db912e5b7b0b887427fbb6ee7e331d0c7c1f7c06a6658c99831" }, "downloads": -1, "filename": "Boruta-0.3.tar.gz", "has_sig": false, "md5_digest": "1d804dccc34427afd007bc0f2fcc630e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 56532, "upload_time": "2019-05-20T07:47:00", "url": "https://files.pythonhosted.org/packages/d5/ab/800c93706b1919dbdcb48fcab3d5251dbd135fa2ca7cd345f7a4dcb0864b/Boruta-0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a5d6038894ecd8017ad6cb61535d0ddc", "sha256": "8269e9c152ae73ed05cd2b347b6b53edc437e1f7b6e1f3d6b8bee1e99d27e963" }, "downloads": -1, "filename": "Boruta-0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "a5d6038894ecd8017ad6cb61535d0ddc", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 56630, "upload_time": "2019-05-20T07:46:58", "url": "https://files.pythonhosted.org/packages/b2/11/583f4eac99d802c79af9217e1eff56027742a69e6c866b295cce6a5a8fc2/Boruta-0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1d804dccc34427afd007bc0f2fcc630e", "sha256": "06d42882a57a4db912e5b7b0b887427fbb6ee7e331d0c7c1f7c06a6658c99831" }, "downloads": -1, "filename": "Boruta-0.3.tar.gz", "has_sig": false, "md5_digest": "1d804dccc34427afd007bc0f2fcc630e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 56532, "upload_time": "2019-05-20T07:47:00", "url": "https://files.pythonhosted.org/packages/d5/ab/800c93706b1919dbdcb48fcab3d5251dbd135fa2ca7cd345f7a4dcb0864b/Boruta-0.3.tar.gz" } ] }