dwave-scikit-learn-plugin


Namedwave-scikit-learn-plugin JSON
Version 0.1.0 PyPI version JSON
download
home_pagehttps://github.com/dwavesystems/dwave-scikit-learn-plugin
SummaryA plugin to scikit-learn for quantum hybrid solving
upload_time2023-03-20 17:56:17
maintainer
docs_urlNone
authorD-Wave Systems Inc.
requires_python>=3.7
licenseApache 2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![PyPI](https://img.shields.io/pypi/v/dwave-scikit-learn-plugin.svg)](https://pypi.python.org/pypi/dwave-scikit-learn-plugin)
[![CircleCI](https://dl.circleci.com/status-badge/img/gh/dwavesystems/dwave-scikit-learn-plugin/tree/main.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/dwavesystems/dwave-scikit-learn-plugin)

# D-Wave `scikit-learn` Plugin

This package provides a [scikit-learn](https://scikit-learn.org/) transformer for 
[feature selection](https://en.wikipedia.org/wiki/Feature_selection) using a
quantum-classical [hybrid solver](https://docs.ocean.dwavesys.com/en/stable/concepts/hybrid.html).

This plugin makes use of a Leap™ quantum-classical hybrid solver. Developers can get started by
[signing up](https://cloud.dwavesys.com/leap/signup/) for the Leap quantum cloud service for free.
Those seeking a more collaborative approach and assistance with building a production application can
reach out to D-Wave [directly](https://www.dwavesys.com/solutions-and-products/professional-services/) and also explore the feature selection [offering](https://aws.amazon.com/marketplace/pp/prodview-bsrc3yuwgjbo4) in AWS Marketplace.

The package's main class, `SelectFromQuadraticModel`, can be used in any existing `sklearn` pipeline.
For an introduction to hybrid methods for feature selection, see the [Feature Selection for CQM](https://github.com/dwave-examples/feature-selection-cqm).

## Examples

A minimal example of using the plugin to select 20 of 30 features of an `sklearn` dataset: 

```python
>>> from sklearn.datasets import load_breast_cancer
>>> from dwave.plugins.sklearn import SelectFromQuadraticModel
... 
>>> X, y = load_breast_cancer(return_X_y=True)
>>> X.shape
(569, 30)
>>> X_new = SelectFromQuadraticModel(num_features=20).fit_transform(X, y)
>>> X_new.shape
(569, 20)
```

For large problems, the default runtime may be insufficient. You can use the CQM solver's 
[`min_time_limit`](https://docs.ocean.dwavesys.com/en/stable/docs_system/reference/generated/dwave.system.samplers.LeapHybridCQMSampler.min_time_limit.html)
method to find the minimum accepted runtime for your problem; alternatively, simply submit as above 
and check the returned error message for the required runtime. 

The feature selector can be re-instantiated with a longer time limit.

```python
>>> X_new = SelectFromQuadraticModel(num_features=20, time_limit=200).fit_transform(X, y)
```

## Installation

To install the core package:

```bash
pip install dwave-scikit-learn-plugin
```

## License

Released under the Apache License 2.0

## Contributing

Ocean's [contributing guide](https://docs.ocean.dwavesys.com/en/stable/contributing.html)
has guidelines for contributing to Ocean packages.

### Release Notes

**dwave-scikit-learn-plugin** makes use of [reno](https://docs.openstack.org/reno/) to manage its
release notes.

When making a contribution to **dwave-scikit-learn-plugin** that will affect users, create a new
release note file by running

```bash
reno new your-short-descriptor-here
```

You can then edit the file created under ``releasenotes/notes/``.
Remove any sections not relevant to your changes.
Commit the file along with your changes.



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/dwavesystems/dwave-scikit-learn-plugin",
    "name": "dwave-scikit-learn-plugin",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "",
    "author": "D-Wave Systems Inc.",
    "author_email": "tools@dwavesys.com",
    "download_url": "https://files.pythonhosted.org/packages/06/93/38dc2525dd3ea7406439e5243d9b8b393e75cf7ddf3fa8431adf01a1a067/dwave-scikit-learn-plugin-0.1.0.tar.gz",
    "platform": null,
    "description": "[![PyPI](https://img.shields.io/pypi/v/dwave-scikit-learn-plugin.svg)](https://pypi.python.org/pypi/dwave-scikit-learn-plugin)\n[![CircleCI](https://dl.circleci.com/status-badge/img/gh/dwavesystems/dwave-scikit-learn-plugin/tree/main.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/dwavesystems/dwave-scikit-learn-plugin)\n\n# D-Wave `scikit-learn` Plugin\n\nThis package provides a [scikit-learn](https://scikit-learn.org/) transformer for \n[feature selection](https://en.wikipedia.org/wiki/Feature_selection) using a\nquantum-classical [hybrid solver](https://docs.ocean.dwavesys.com/en/stable/concepts/hybrid.html).\n\nThis plugin makes use of a Leap\u2122 quantum-classical hybrid solver. Developers can get started by\n[signing up](https://cloud.dwavesys.com/leap/signup/) for the Leap quantum cloud service for free.\nThose seeking a more collaborative approach and assistance with building a production application can\nreach out to D-Wave [directly](https://www.dwavesys.com/solutions-and-products/professional-services/) and also explore the feature selection [offering](https://aws.amazon.com/marketplace/pp/prodview-bsrc3yuwgjbo4) in AWS Marketplace.\n\nThe package's main class, `SelectFromQuadraticModel`, can be used in any existing `sklearn` pipeline.\nFor an introduction to hybrid methods for feature selection, see the [Feature Selection for CQM](https://github.com/dwave-examples/feature-selection-cqm).\n\n## Examples\n\nA minimal example of using the plugin to select 20 of 30 features of an `sklearn` dataset: \n\n```python\n>>> from sklearn.datasets import load_breast_cancer\n>>> from dwave.plugins.sklearn import SelectFromQuadraticModel\n... \n>>> X, y = load_breast_cancer(return_X_y=True)\n>>> X.shape\n(569, 30)\n>>> X_new = SelectFromQuadraticModel(num_features=20).fit_transform(X, y)\n>>> X_new.shape\n(569, 20)\n```\n\nFor large problems, the default runtime may be insufficient. You can use the CQM solver's \n[`min_time_limit`](https://docs.ocean.dwavesys.com/en/stable/docs_system/reference/generated/dwave.system.samplers.LeapHybridCQMSampler.min_time_limit.html)\nmethod to find the minimum accepted runtime for your problem; alternatively, simply submit as above \nand check the returned error message for the required runtime. \n\nThe feature selector can be re-instantiated with a longer time limit.\n\n```python\n>>> X_new = SelectFromQuadraticModel(num_features=20, time_limit=200).fit_transform(X, y)\n```\n\n## Installation\n\nTo install the core package:\n\n```bash\npip install dwave-scikit-learn-plugin\n```\n\n## License\n\nReleased under the Apache License 2.0\n\n## Contributing\n\nOcean's [contributing guide](https://docs.ocean.dwavesys.com/en/stable/contributing.html)\nhas guidelines for contributing to Ocean packages.\n\n### Release Notes\n\n**dwave-scikit-learn-plugin** makes use of [reno](https://docs.openstack.org/reno/) to manage its\nrelease notes.\n\nWhen making a contribution to **dwave-scikit-learn-plugin** that will affect users, create a new\nrelease note file by running\n\n```bash\nreno new your-short-descriptor-here\n```\n\nYou can then edit the file created under ``releasenotes/notes/``.\nRemove any sections not relevant to your changes.\nCommit the file along with your changes.\n\n\n",
    "bugtrack_url": null,
    "license": "Apache 2.0",
    "summary": "A plugin to scikit-learn for quantum hybrid solving",
    "version": "0.1.0",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3f76fb2dd6e9b43a1337af39e76c6d5d0eec0d74794e2c28b47dd357ec3887ba",
                "md5": "8b2adb7e403958efc3e0b57be6cdaeb5",
                "sha256": "7d8bb6936aef8ca4a395044c417db8b6602a8b74d3a76e6e17672a1073781ecf"
            },
            "downloads": -1,
            "filename": "dwave_scikit_learn_plugin-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "8b2adb7e403958efc3e0b57be6cdaeb5",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 15544,
            "upload_time": "2023-03-20T17:56:15",
            "upload_time_iso_8601": "2023-03-20T17:56:15.915673Z",
            "url": "https://files.pythonhosted.org/packages/3f/76/fb2dd6e9b43a1337af39e76c6d5d0eec0d74794e2c28b47dd357ec3887ba/dwave_scikit_learn_plugin-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "069338dc2525dd3ea7406439e5243d9b8b393e75cf7ddf3fa8431adf01a1a067",
                "md5": "0f80a4600bebe81ae0c58c50ff347548",
                "sha256": "3d2b56dfb313041a9e4ca0cb13e0a730d4f5108818a2c74d4201ec4380706a07"
            },
            "downloads": -1,
            "filename": "dwave-scikit-learn-plugin-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "0f80a4600bebe81ae0c58c50ff347548",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 14073,
            "upload_time": "2023-03-20T17:56:17",
            "upload_time_iso_8601": "2023-03-20T17:56:17.819009Z",
            "url": "https://files.pythonhosted.org/packages/06/93/38dc2525dd3ea7406439e5243d9b8b393e75cf7ddf3fa8431adf01a1a067/dwave-scikit-learn-plugin-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-03-20 17:56:17",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "dwavesystems",
    "github_project": "dwave-scikit-learn-plugin",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "circle": true,
    "requirements": [],
    "lcname": "dwave-scikit-learn-plugin"
}
        
Elapsed time: 0.04704s