DOC add Bunch to public docs and API#16404
Conversation
NicolasHug
left a comment
There was a problem hiding this comment.
Thanks @adrinjalali . We should also update the docstrings of the utilities outputting a Bunch to link to the doc now
sklearn/utils/__init__.py
Outdated
| ``Bunch`` is a dictionary-like object that exposes its keys as attributes. | ||
| It is sometimes used as an output and sometimes to store certain | ||
| information in attributes of certain objects. This object should not be | ||
| used as an input parameter. |
There was a problem hiding this comment.
sometimes to store certain information in attributes of certain objects
What cases is this referring to?
This object should not be used as an input parameter.
Isn't this one of these cases where we're just giving bad ideas? I.e. no one would have thought of that in the first place? Just wondering
There was a problem hiding this comment.
Isn't this one of these cases where we're just giving bad ideas? I.e. no one would have thought of that in the first place? Just wondering
It's in the FAQ, doesn't hurt to tell people not to do that.
What cases is this referring to?
named_estimator_ for instance.
That can be a good issue for a sprint. |
glemaitre
left a comment
There was a problem hiding this comment.
I'm +1. I would agree to merge whatever you answer you give to my comment :)
|
|
||
| Bunch objects are sometimes used as an output for functions and methods. | ||
| They extend dictionaries by enabling values to be accessed by key, | ||
| `bunch["value_key"]`, or by an attribute, `bunch.value_key`. |
There was a problem hiding this comment.
Do we want to follow a strict NumPy documentation (add Examples section and something about the Attributes)?
There was a problem hiding this comment.
Id say that's fine, the docstring is pretty clear
|
The doc can always be improved ;) |
Could you open one please @adrinjalali |
* add Bunch to public docs and API * address Thomas's suggestions * use Thomas's description
* add Bunch to public docs and API * address Thomas's suggestions * use Thomas's description
Adding the
Bunchobject to the public API in the docs, and changing the FAQ to mention it shouldn't be used as input.ping @thomasjpfan , does this look ok?
Fixes #16390