-
-
Notifications
You must be signed in to change notification settings - Fork 211
Extend extensions page #1080
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
Extend extensions page #1080
Conversation
mfeurer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. I have a few minor suggestions on how to improve it.
Co-authored-by: Matthias Feurer <[email protected]>
Co-authored-by: Matthias Feurer <[email protected]>
prabhant
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, A small change can be added too :)
| etc) and that the chosen model will be inferred from the optimization trace. | ||
| * :meth:`check_if_model_fitted`: Check whether the train method of the model | ||
| has been called (and as such, whether the predict method can be used). | ||
| * Hyperparameter optimization (optional) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A small addition that can be added here is
The optional methods have to be initialized as an empty function example:
def instantiate_model_from_hpo_class():
"This is just an empty function to avoid errors"
It can be confusing for some users to get errors that this optional method is not implemented. So here we can add that though these methods are optional they should still be present in the extension as an empty function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean exactly? I would just suggest users to raise a NotImplementedError (since that method will only be invoked externally)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the end, you still need these optional methods to exist in the extension, While using the extension openml-python does require the optional methods to exist too(at least that was the issue I faced while developing openml-tensorflow). So I just defined the functions without definitions like here: https://github.com/openml/openml-tensorflow/blob/master/openml_tensorflow/extension.py
But it was confusing for me at first when I was getting those errors, so I think it will be helpful to add a message regarding that here(that we still need to define these methods as empty methods if we don't want to implement them).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the end, you still need these optional methods to exist in the extension
Are you sure? Since the extensin inherits from the Extension interface, we technically do not need to implement it in the specific right?
Just to be sure, I added:
Note that although this method is optional, for the extension to work it
needs to exist. If this function is not required, we recommend to have an
empty function that raises aNotImplementedErrorwith a useful error
message.
|
|
||
| * General setup (required) | ||
| * :meth:`can_handle_flow`: Takes as argument an OpenML flow, and checks | ||
| whether this can be handled by the current extension. The OpenML database |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docbuild fails because this indentation will lead to a warning (which we don't allow). In case you have issues building docs locally there's also a docker image available.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should I remove all line breaks?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line breaks are OK, but it's indented too far for this parser. Content for the lists should only be indented as far as the asterisks (not sure why the parser wants this, to be honest).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a misleading error message. I added a line break and it now works. I created a commit which fixes doc building and will now create a commit fixing the merge conflicts arising from this.
PGijsbers
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! There is one grammatical error (and two suggestions). But the docs currently don't build without warning because of the indentation.
Co-authored-by: PGijsbers <[email protected]>
Co-authored-by: PGijsbers <[email protected]>
Co-authored-by: PGijsbers <[email protected]>
doc/extensions.rst
Outdated
|
|
||
|
|
||
| this method also sets the hyperparameters of a model). | ||
| Note that although this method is optional, for the extension to work it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't it rather be that the implementing the logic is optional but that the function needs to exists? So
Note that although this method is required, it is not necessary to implement any logic if hyperparameter optimization is not implemented. Simply raise a `NotImplementedError` then.
* started working on additional information for extension * extended documentation * final pass over extensions * Update doc/extensions.rst Co-authored-by: Matthias Feurer <[email protected]> * Update doc/extensions.rst Co-authored-by: Matthias Feurer <[email protected]> * changes suggested by MF * Update doc/extensions.rst Co-authored-by: PGijsbers <[email protected]> * Update doc/extensions.rst Co-authored-by: PGijsbers <[email protected]> * Update doc/extensions.rst Co-authored-by: PGijsbers <[email protected]> * added info to optional method * fix documentation building * updated doc Co-authored-by: Matthias Feurer <[email protected]> Co-authored-by: PGijsbers <[email protected]>
adds more documentation how to add extensions to OpenML Python