-
-
Notifications
You must be signed in to change notification settings - Fork 26.5k
adding length function to pipeline.py #13439
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is almost there! Thanks
jnothman
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.
otherwise LGTM
|
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?