Skip to content

Conversation

@ytzfhqs
Copy link
Contributor

@ytzfhqs ytzfhqs commented Jul 18, 2024

The example sampling results in the comments of the random_sample() function in the target_space.py file may have been written backwards.

Examples -------- >>> target_func = lambda p1, p2: p1 + p2 >>> pbounds = {'p1': (0, 1), 'p2': (1, 100)} >>> space = TargetSpace(target_func, pbounds, random_state=0) >>> space.random_sample() array([[ 55.33253689, 0.54488318]])

It should be amended to:

Examples -------- >>> target_func = lambda p1, p2: p1 + p2 >>> pbounds = {'p1': (0, 1), 'p2': (1, 100)} >>> space = TargetSpace(target_func, pbounds, random_state=0) >>> space.random_sample() array([[0.54488318 , 55.33253689]])

The example may mislead users.

@till-m till-m changed the title Examples error in random_sample function Fix docs: random_sample function Jul 23, 2024
@till-m till-m changed the title Fix docs: random_sample function fix docs for TargetSpace.random_sample Jul 23, 2024
@till-m till-m merged commit dc4e8ef into bayesian-optimization:master Jul 23, 2024
@till-m
Copy link
Member

till-m commented Jul 23, 2024

Thanks for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants