X Tutup
Skip to content

fix docs for TargetSpace.random_sample#501

Merged
t-muser merged 1 commit intobayesian-optimization:masterfrom
ytzfhqs:master
Jul 23, 2024
Merged

fix docs for TargetSpace.random_sample#501
t-muser merged 1 commit intobayesian-optimization:masterfrom
ytzfhqs:master

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.

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

t-muser 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

X Tutup