adding length function to pipeline.py#13439
adding length function to pipeline.py#13439adrinjalali merged 12 commits intoscikit-learn:masterfrom
Conversation
|
The method should be |
Sure, I will change the method name and will also add test. |
jnothman
left a comment
There was a problem hiding this comment.
This is almost there! Thanks
|
Please add an |
ok adding that :-) |
sklearn/tests/test_pipeline.py
Outdated
| ('scaler', scaler_for_pipeline), | ||
| ('Kmeans', km_for_pipeline) | ||
| ]) | ||
| assert len(pipeline) == 2 |
There was a problem hiding this comment.
I would have just updated with 1 line an existing test but whatever. LGTM
doc/whats_new/v0.21.rst
Outdated
|
|
||
| - |Enhancement| :class:`pipeline.Pipeline` now implements a func | ||
| :func:`__len__()`, | ||
| that will return the length of the pipeline :issue:`13439` |
There was a problem hiding this comment.
Please put . after "pipeline".
It would be nice if this message made it clearer to users that len will now work
There was a problem hiding this comment.
ok I will shift the . after "pipeline", do you want me to modify the message and write like this:
:class:pipeline.Pipeline now implements a func len,
that will now work and return the length of the pipeline. :issue:13439 by :user:Lakshya KD <LakshKD>.
There was a problem hiding this comment.
I have modified the message, do let me know if it requires any changes.
|
thanks @LakshKD |
* adding length function to pipeline.py * modified length function name and added test * added space in test__len__() function * modified test_pipeline.py * removed extra space in test_pipeline.py * modified assert statement * added the enhancement label in changelog of v0.21.rst * modified the enhancement label in changelog of v0.21.rst * modified message in changelog file * modified test and changed enhancement message * added backticks in message
This reverts commit 77c4a47.
This reverts commit 77c4a47.
* adding length function to pipeline.py * modified length function name and added test * added space in test__len__() function * modified test_pipeline.py * removed extra space in test_pipeline.py * modified assert statement * added the enhancement label in changelog of v0.21.rst * modified the enhancement label in changelog of v0.21.rst * modified message in changelog file * modified test and changed enhancement message * added backticks in message
Reference Issues/PRs
Fixes #13418
What does this implement/fix? Explain your changes.
Adding length function in pipeline.py file that will return the length of the pipeline.
Any other comments?