dwavesystems / dwave-scikit-learn-plugin Goto Github PK
View Code? Open in Web Editor NEWA plugin to scikit-learn for quantum-classical hybrid solving
License: Apache License 2.0
A plugin to scikit-learn for quantum-classical hybrid solving
License: Apache License 2.0
Readme - Add reference to scikit learn documentation for details on how to prepare data for and use the package
The time_limit
keyword is not used in the fit
dwave-scikit-learn-plugin/dwave/plugins/sklearn/transformers.py
Lines 222 to 230 in 7db7d03
The variable time_limit
is not passed to the solver, instead, an internal variable is passed.
dwave-scikit-learn-plugin/dwave/plugins/sklearn/transformers.py
Lines 296 to 297 in 7db7d03
D-wave system functions have a parameter called 'token' to pass it. But I don't know how pass this parameter to run the simple example of this web with SelectFromQuadraticModel(num_features=20).fit_transform(X_tmp.values, y.values)
Regards,
Is this plugin up to date? Can we use it?
It would be nice to have the titanic dataset that we use in our examples (link, link, link), available in code. Something like
from dwave.plugins.sklearn.datasets import load_titanic
to mirror scikit-learn's datasets
Currently, it is possible to construct a dataset where, even with alpha=1
, a fixed or random column is chosen because of the penalties in the quadratic term. This contradicts the docstring which claims
alpha:
Hyperparameter between 0 and 1 that controls the relative weight of
the relevance and redundancy terms.
``alpha=0`` places no weight on the quality of the features,
therefore the features will be selected as to minimize the
redundancy without any consideration to quality.
``alpha=1`` places the maximum weight on the quality of the features,
and therefore will be equivalent to using
:class:`sklearn.feature_selection.SelectKBest`.
One solution is to multiply the quadratic/redundany terms by 1-alpha
to ensure that they are zeroed when alpha=1
.
For instance we could replace
dwave-scikit-learn-plugin/dwave/plugins/sklearn/transformers.py
Lines 210 to 212 in 7db7d03
diag = np.array(correlations[:, -1] * (-2 * alpha * num_features), copy=True)
correlations *= (1-alpha)
# our objective
# we multiply by 2 because the matrix is symmetric
np.fill_diagonal(correlations, diag)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.