question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Make suggest API more consistent and improve documentation

See original GitHub issue

Motivation

We want to make behaviors of suggesting API for integer parameters and floating-point parameters consistent. Our focuses are summarized in the description.

Description

1. Suggest APIs variant for floating-point

There are four methods available for the current suggest API for a floating-point parameter: suggest_float, suggest_uniform, suggest_loguniform, and suggest_discrete_uniform. On the other hand, there is one method for each integer and categorical parameter: suggest_int and suggest_categorical. We plan to unify methods for floating point parameter into suggest_float and deprecate suggest_uniform, suggest_loguniform, and suggest_discrete_uniform. Then, we can change the implementation of suggest_uniform, suggest_loguniform, and suggest_discrete_uniform so that they are wrapped by suggest_float.

2. Documentation about behavior about the upper endpoint of floating-point distribution

While suggest API for an integer parameter would return the upper endpoint of the parameter space, suggest API for a float parameter would not return the upper endpoint according to documentation. Although it is true for some situations (e.g. TPESampler), samplers could return an upper endpoint due to numerical error of a floating-point. We decided to update our documentation that an upper endpoint would be included as a result of suggest API for float.

3. Allowing suggest_float to add a parameter during optimization (to make consistent with suggest_int)

In the current implementation, behavior is different between integer and float when adding a parameter (e.g. step) to suggest API during an optimization process. An error occurs for float while it works in the integer. To make the behavior consistent, we plan to change suggest_float so that it works when adding an additional parameter during optimization.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:16 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
HideakiImamuracommented, Feb 24, 2022

[note] This issue will be closed in #3113.

2reactions
himktcommented, Nov 16, 2021

@xadrianzetx Right, let’s go on to the final step! 🚀

Read more comments on GitHub >

github_iconTop Results From Across the Web

6 Practices to Achieve Consistency across API Specifications
6 Practices to Achieve Consistency across API Specifications · 1. Create a Style Guide · 2. Promote Visibility and Reusability · 3. Separate...
Read more >
5 Golden Rules for Great Web API Design - Toptal
Here's how to design a great web API that is much more likely to be adopted and used. ... Documentation; Stability and Consistency;...
Read more >
7 Tips to Write Great API Documentation
Create a Consistent API That Follows Convention; Write API Documentation That Decision-Makers and Developers Can Understand; Great API ...
Read more >
Creating processes for API clarity and consistency - Plaid
The primary way we enforce API consistency is through the API Review Council (APIRC).
Read more >
Best Practices in API Design - Swagger
Complete and concise: Finally, a complete API will make it possible for developers ... more information needed, provide links to additional documentation.
Read more >

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found