trial.suggest_uniform sampling very non-uniform
See original GitHub issueProblem
Using a call like:
colsample_bytree = trial.suggest_uniform('colsample_bytree', 0.1, 0.9)
produces a highly skewed distribution:
Expected behavior
The distribution should be closer to uniform
Environment
- Optuna version:
optuna.__version__
Out[47]: '0.19.0'
- Python version:
python 3.6.9 h5500b2f_0
- OS:
OS Name : Microsoft Windows 10 Home
OS Version : 10.0.18362 N/A Build 18362
OS Manufacturer : Microsoft Corporation
OS Configuration : Standalone Workstation
OS Build Type : Multiprocessor Free
System Boot Time : 1/15/2020, 5:34:36 PM
System Manufacturer : LENOVO
System Model : 20349
System Type : x64-based PC
System Directory : C:\Windows\system32
System Locale : en-us;English (United States)
Hotfix(s) : 11 Hotfix(s) Installed.,[01]: KB4532938,[02]: KB4497165,[03]: KB4498523,[04]: KB4503308,[05]: KB4515383,[06]: KB4516115,[07]: KB4520390,[08]: KB4521863,[09]: KB4524569,[10]:
KB4528759,[11]: KB4528760
- (Optional) Other libraries and their versions:
xgb.__version__
Out[50]: '0.90'
Error messages, stack traces, or logs
None
Steps to reproduce
def train_model(trial,
train_X,
train_Y,
val_X,
val_Y,
n_iters,
params,
n_class = None):
colsample_bytree = trial.suggest_uniform('colsample_bytree', 0.1, 0.9)
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Performance tuning non-uniform sampling for sensitivity ...
Non-uniform sampling (NUS) has been established as a route to obtaining true sensitivity enhancements when recording indirect dimensions of ...
Read more >Nonuniform Sampling (NUS): Principles, Applications, Tools
On Thusday January 14, 2021 Professor David Rovnyak of Bucknell University lead a workshop about methods of non-uniform sampling (NUS).
Read more >Resampling Nonuniformly Sampled Signals - MathWorks
This example shows how to resample nonuniformly sampled signals to a new uniform rate. It shows how to apply a custom filter on...
Read more >Numerical analysis of the non-uniform sampling problem
The solution of the nonuniform sampling problem poses much more difficulties ... practice very important case when the bandwidth of the signal is...
Read more >Differential Domain Analysis for Non-uniform Sampling
knowledge ρ has been applied only to uniform sampling so far, and we show in this paper how it can be extended to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The default sampler for a study is
TPESampler
. The following might solve your issue, by changing sampler to RandomSampler (based on numpy.random):This yields the following distribution:
@eafpres Thank you for your question. As suggested by @SBrandeis , that is the expected behavior of the default sampler.
TPESampler
tries to sample new parameter values from promising areas in order to get optimal parameter values. As a result, the distribution of suggested values will be skewed. Please refer to this document for further details of TPESampler.By the way, I feel that the name of
suggest_uniform
is a bit confusing. IMO, renaming it to the name which is consistent with the behavior can be helpful for users.@SBrandeis Thank you for your prompt reply!