Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix docs for TargetSpace.random_sample #501

Merged
merged 1 commit into from
Jul 23, 2024

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
10 checks passed
@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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants