{"id":14970670,"url":"https://github.com/epistasislab/scikit-mdr","last_synced_at":"2025-04-09T15:04:40.341Z","repository":{"id":43305577,"uuid":"60634158","full_name":"EpistasisLab/scikit-mdr","owner":"EpistasisLab","description":"A sklearn-compatible Python implementation of Multifactor Dimensionality Reduction (MDR) for feature construction.","archived":false,"fork":false,"pushed_at":"2023-06-14T17:41:37.000Z","size":141,"stargazers_count":125,"open_issues_count":11,"forks_count":26,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-04-09T15:04:35.416Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EpistasisLab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2016-06-07T17:49:04.000Z","updated_at":"2025-01-28T03:55:14.000Z","dependencies_parsed_at":"2022-09-19T05:30:30.750Z","dependency_job_id":null,"html_url":"https://github.com/EpistasisLab/scikit-mdr","commit_stats":{"total_commits":80,"total_committers":5,"mean_commits":16.0,"dds":"0.32499999999999996","last_synced_commit":"ccc9278de5219b91d933da684bc42a02baa8cd78"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EpistasisLab%2Fscikit-mdr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EpistasisLab%2Fscikit-mdr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EpistasisLab%2Fscikit-mdr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EpistasisLab%2Fscikit-mdr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EpistasisLab","download_url":"https://codeload.github.com/EpistasisLab/scikit-mdr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248055284,"owners_count":21040157,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-24T13:43:58.091Z","updated_at":"2025-04-09T15:04:40.317Z","avatar_url":"https://github.com/EpistasisLab.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Master status: [![Build Status](https://travis-ci.org/EpistasisLab/scikit-mdr.svg?branch=master)](https://travis-ci.org/EpistasisLab/scikit-mdr)\n[![Code Health](https://landscape.io/github/EpistasisLab/scikit-mdr/master/landscape.svg?style=flat)](https://landscape.io/github/EpistasisLab/scikit-mdr/master)\n[![Coverage Status](https://coveralls.io/repos/github/EpistasisLab/scikit-mdr/badge.svg?branch=master)](https://coveralls.io/github/EpistasisLab/scikit-mdr?branch=master)\n\nDevelopment status: [![Build Status](https://travis-ci.org/EpistasisLab/scikit-mdr.svg?branch=development)](https://travis-ci.org/EpistasisLab/scikit-mdr)\n[![Code Health](https://landscape.io/github/EpistasisLab/scikit-mdr/development/landscape.svg?style=flat)](https://landscape.io/github/EpistasisLab/scikit-mdr/development)\n[![Coverage Status](https://coveralls.io/repos/github/EpistasisLab/scikit-mdr/badge.svg?branch=development)](https://coveralls.io/github/EpistasisLab/scikit-mdr?branch=development)\n\nPackage information: ![Python 2.7](https://img.shields.io/badge/python-2.7-blue.svg)\n![Python 3.6](https://img.shields.io/badge/python-3.6-blue.svg)\n![License](https://img.shields.io/badge/license-MIT%20License-blue.svg)\n[![PyPI version](https://badge.fury.io/py/scikit-MDR.svg)](https://badge.fury.io/py/scikit-MDR)\n\n[![Join the chat at https://gitter.im/EpistasisLab/scikit-mdr](https://badges.gitter.im/EpistasisLab/scikit-mdr.svg)](https://gitter.im/EpistasisLab/scikit-mdr?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://github.com/EpistasisLab/scikit-mdr/raw/development/images/mdr-logo.jpg\" width=600 /\u003e\n\u003c/p\u003e\n\n# MDR\n\nA scikit-learn-compatible Python implementation of Multifactor Dimensionality Reduction (MDR) for feature construction. **This project is still under active development** and we encourage you to check back on this repository regularly for updates.\n\nMDR is an effective feature construction algorithm that is capable of modeling higher-order interactions and capturing complex patterns in data sets.\n\nMDR currently only works with categorical features and supports both binary classification and regression problems. We are working on expanding the algorithm to cover more problem types and provide more convenience features.\n\n## License\n\nPlease see the [repository license](https://github.com/EpistasisLab/scikit-mdr/blob/master/LICENSE) for the licensing and usage information for the MDR package.\n\nGenerally, we have licensed the MDR package to make it as widely usable as possible.\n\n## Installation\n\nMDR is built on top of the following existing Python packages:\n\n* NumPy\n\n* SciPy\n\n* scikit-learn\n\n* matplotlib\n\nAll of the necessary Python packages can be installed via the [Anaconda Python distribution](https://www.continuum.io/downloads), which we strongly recommend that you use. We also strongly recommend that you use Python 3 over Python 2 if you're given the choice.\n\nNumPy, SciPy, scikit-learn, and matplotlib can be installed in Anaconda via the command:\n\n```\nconda install numpy scipy scikit-learn matplotlib\n```\n\nOnce the prerequisites are installed, you should be able to install MDR with a `pip` command:\n\n```\npip install scikit-mdr\n```\n\nPlease [file a new issue](https://github.com/EpistasisLab/scikit-mdr/issues/new) if you run into installation problems.\n\n## Examples\n\nMDR has been coded with a scikit-learn-like interface to be easy to use. The typical `fit`, `transform`, and `fit_transform` methods are available for every feature construction algorithm. For example, MDR can be used to construct a new feature composed from two existing features:\n\n```python\nfrom mdr import MDR\nimport pandas as pd\n\ngenetic_data = pd.read_csv('https://github.com/EpistasisLab/scikit-mdr/raw/development/data/GAMETES_Epistasis_2-Way_20atts_0.4H_EDM-1_1.tsv.gz', sep='\\t', compression='gzip')\n\nfeatures = genetic_data.drop('class', axis=1).values\nlabels = genetic_data['class'].values\n\nmy_mdr = MDR()\nmy_mdr.fit(features, labels)\nmy_mdr.transform(features)\n\u003e\u003e\u003earray([[1],\n\u003e\u003e\u003e       [1],\n\u003e\u003e\u003e       [1],\n\u003e\u003e\u003e       ...,\n\u003e\u003e\u003e       [0],\n\u003e\u003e\u003e       [0],\n\u003e\u003e\u003e       [0]])\n```\n\nYou can also use MDR as a classifier, and evaluate the quality of the constructed feature with the `score` function:\n\n```python\nfrom mdr import MDRClassifier\nimport pandas as pd\n\ngenetic_data = pd.read_csv('https://github.com/EpistasisLab/scikit-mdr/raw/development/data/GAMETES_Epistasis_2-Way_20atts_0.4H_EDM-1_1.tsv.gz', sep='\\t', compression='gzip')\n\nfeatures = genetic_data.drop('class', axis=1).values\nlabels = genetic_data['class'].values\n\nmy_mdr = MDRClassifier()\nmy_mdr.fit(features, labels)\nmy_mdr.score(features, labels)\n\u003e\u003e\u003e0.998125\n```\n\nIf you want to use MDR for regression problems, use `ContinuousMDR`:\n\n```python\nfrom mdr import ContinuousMDR\nimport pandas as pd\n\ngenetic_data = pd.read_csv('https://github.com/EpistasisLab/scikit-mdr/raw/development/data/GAMETES_Epistasis_2-Way_continuous_endpoint_a_20s_1600her_0.4__maf_0.2_EDM-2_01.tsv.gz', sep='\\t', compression='gzip')\nfeatures = genetic_data[['M0P0', 'M0P1']].values\ntargets = genetic_data['Class'].values\n\nmy_cmdr = ContinuousMDR()\nmy_cmdr.fit(features, targets)\nmy_cmdr.transform(features)\n\u003e\u003e\u003earray([[0],\n\u003e\u003e\u003e       [1],\n\u003e\u003e\u003e       [1],\n\u003e\u003e\u003e       ...,\n\u003e\u003e\u003e       [0],\n\u003e\u003e\u003e       [1],\n\u003e\u003e\u003e       [1]])\n```\n\n## Contributing to MDR\n\nWe welcome you to [check the existing issues](https://github.com/EpistasisLab/scikit-mdr/issues/) for bugs or enhancements to work on. If you have an idea for an extension to the MDR package, please [file a new issue](https://github.com/EpistasisLab/scikit-mdr/issues/new) so we can discuss it.\n\n## Having problems or have questions about MDR?\n\nPlease [check the existing open and closed issues](https://github.com/EpistasisLab/scikit-mdr/issues?utf8=%E2%9C%93\u0026q=is%3Aissue) to see if your issue has already been attended to. If it hasn't, [file a new issue](https://github.com/EpistasisLab/scikit-mdr/issues/new) on this repository so we can review your issue.\n\n## Citing MDR\n\nIf you use this software in a publication, please consider citing it. You can cite the repository directly with the following DOI:\n\n[blank for now]\n\n## Support for MDR\n\nThe MDR package was developed in the [Computational Genetics Lab](http://epistasis.org) with funding from the [NIH](http://www.nih.gov). We're incredibly grateful for their support during the development of this project.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fepistasislab%2Fscikit-mdr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fepistasislab%2Fscikit-mdr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fepistasislab%2Fscikit-mdr/lists"}