Code Monkey home page Code Monkey logo

dwave-scikit-learn-plugin's People

Contributors

arcondello avatar joelpasvolsky avatar juansebastianl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dwave-scikit-learn-plugin's Issues

`time_limit` keyword is not used in `fit` method

The time_limit keyword is not used in the fit

def fit(
self,
X: npt.ArrayLike,
y: npt.ArrayLike,
*,
alpha: typing.Optional[float] = None,
num_features: typing.Optional[int] = None,
time_limit: typing.Optional[float] = None,
) -> SelectFromQuadraticModel:

The variable time_limit is not passed to the solver, instead, an internal variable is passed.

sampleset = sampler.sample_cqm(cqm, time_limit=self.time_limit,
label=f"{self.__module__}.{type(self).__qualname__}")

If I use Jupyter or Colab how can I put token API?

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,

Consider multiplying the quadratic biases in `SelectFromQuadraticModel.correlation_cqm()` by `1-alpha`.

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

# our objective
# we multiply by 2 because the matrix is symmetric
np.fill_diagonal(correlations, correlations[:, -1] * (-2 * alpha * num_features))
with

            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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.