Comments (3)
My function I'm trying to optimize looks like this
def crossValScore(c):
scores = []
for trainI, testI in StratifiedShuffleSplit(y, 10, test_size=.1,):
lr = LR(C=c)
Xtr = X[trainI,:]
ytr = y[trainI]
Xts = X[testI,:]
yts = y[testI]
lr.fit(Xtr, ytr)
scores.append(f1_score(yts, lr.predict(Xts)))
scores = np.array(scores)
return np.mean(scores)
my call looks like
bo = BayesianOptimization(crossValScore, {'c':(.00001, 100000)})
bo.maximize(init_points = 15, n_iter=100)
from bayesianoptimization.
This is sklearn's GP object complaining. I believe that due to the vastly different scales between lower and upper bounds it makes it a bit harder on the GP.
You can follow their instruction and increase theta0, or increasing the nugget can help sometimes as well. To so you may simply pass these as parameters to maximize
, which will redirect them to the GP object.
The default value for theta0 is: theta0=numpy.random.uniform(0.001, 0.05, n_params)
Alternatively you can either narrow down the search space, or log-transform it, something along the lines of:
def crossValScore(log_c):
c = exp(log_c)
...
and adjust the bounds accordingly.
from bayesianoptimization.
I log-transformed it and am not getting the error -- thanks!
from bayesianoptimization.
Related Issues (20)
- How to specify pbounds when there are no variable names per se HOT 7
- Make n_restarts_optimizer dynamic HOT 2
- pbounds step size HOT 2
- Manually provide observed samples as init points HOT 2
- Pass *args, *kwargs as non-optimized arguments to the cost function HOT 3
- Verbose=2 doesn't work in terminal or bash HOT 1
- 'str object has no attribute reproduce' HOT 5
- add supported python versions badge to readme HOT 1
- NotUniqueError encountered for constrained problems. HOT 4
- [Question] can I use ML model as a black_box function? HOT 2
- random_state not working as expected when using constraints HOT 4
- How to use specific init_points HOT 3
- Move `static` inside `docsrc` HOT 1
- Problem about ```allow_duplicate_points``` HOT 3
- Experience with 4D or higher parameter spaces HOT 4
- `suggest` does not return the maximum of acquisition function HOT 7
- ```constraint``` and ```allow_duplicate_points``` can't be used at the same time. HOT 1
- Constrained optimization but constraint function is unknown HOT 4
- Visualization HOT 5
- Inclusion of other adquisition functions HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bayesianoptimization.