Coder Social home page Coder Social logo

Comments (4)

till-m avatar till-m commented on May 31, 2024

Hi @BSchuett-fzi,

I assume that your function is reasonably well conditioned and differentiable. If that's the case, 2000 iterations really should not happen.
One quick and easy thing to try: By default, this optimizer uses the Matern kernel with an isotropic lengthscale setting. If your problem is not isotropic, I could see this causing issues. You can use

# instatiate the optimizer
...
# replace kernel
kernel = Matern(nu=2.5),
            alpha=1e-6,
            normalize_y=True,
            n_restarts_optimizer=5,
            length_scale=np.ones(4), # default = 1.0
            random_state=optimizer.random_state
)
optimizer.set_gp_params(kernel=kernel)
# optimization loop
...

to replace it with an anisotropic one.

Let us know if this helps.

from bayesianoptimization.

BSchuett-fzi avatar BSchuett-fzi commented on May 31, 2024

Thanks for your hint.
I'm sorry to ask, but do I still use a GaussianProcessRegressor? I have this code now:

gp = GaussianProcessRegressor(kernel = Matern(nu=2.5),
                            alpha=1e-6,
                            normalize_y=True,
                            n_restarts_optimizer=5,
                            length_scale=np.ones(4),  # default = 1.0
                            random_state=optimizer._random_state)
            optimizer.set_gp_params(kernel=gp)

But the length_scale is not an existing argument. I use scikit-learn 1.3.2.

from bayesianoptimization.

till-m avatar till-m commented on May 31, 2024

Hi @BSchuett-fzi,

no worries. Yes, it still uses a gp. the .set_gp_params function simply replaces some parts of the gp, in this case the kernel. The length scale is an argument of the kernel, not an argument of the gp (hence your code not working).

I hope this helps, please let us know otherwise :)

from bayesianoptimization.

till-m avatar till-m commented on May 31, 2024

Hi @BSchuett-fzi,

I will close this issue for now with the hope that the problem has been fixed. If it persits, feel free to reopen.

from bayesianoptimization.

Related Issues (20)

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.