Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@LakshKD
Copy link
Contributor

@LakshKD LakshKD commented Mar 12, 2019

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?

@jnothman
Copy link
Member

The method should be __len__. Please add a test to test_pipeline.py

@LakshKD
Copy link
Contributor Author

LakshKD commented Mar 13, 2019

The method should be __len__. Please add a test to test_pipeline.py

Sure, I will change the method name and will also add test.

Copy link
Member

@jnothman jnothman left a 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

Copy link
Member

@jnothman jnothman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

otherwise LGTM

@jnothman
Copy link
Member

Please add an |Enhancement| entry to the change log at doc/whats_new/v0.21.rst. Like the other entries there, please reference this pull request with :issue: and credit yourself (and other contributors if applicable) with :user:

@LakshKD
Copy link
Contributor Author

LakshKD commented Mar 13, 2019

Please add an |Enhancement| entry to the change log at doc/whats_new/v0.21.rst. Like the other entries there, please reference this pull request with :issue: and credit yourself (and other contributors if applicable) with :user:

ok adding that :-)

('scaler', scaler_for_pipeline),
('Kmeans', km_for_pipeline)
])
assert len(pipeline) == 2
Copy link
Member

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


- |Enhancement| :class:`pipeline.Pipeline` now implements a func
:func:`__len__()`,
that will return the length of the pipeline :issue:`13439`
Copy link
Member

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

Copy link
Contributor Author

@LakshKD LakshKD Mar 15, 2019

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>.

Copy link
Contributor Author

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.

@adrinjalali adrinjalali merged commit 3a2fbe1 into scikit-learn:master Mar 16, 2019
@adrinjalali
Copy link
Member

thanks @LakshKD

xhluca pushed a commit to xhluca/scikit-learn that referenced this pull request Apr 28, 2019
* 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
xhluca pushed a commit to xhluca/scikit-learn that referenced this pull request Apr 28, 2019
xhluca pushed a commit to xhluca/scikit-learn that referenced this pull request Apr 28, 2019
koenvandevelde pushed a commit to koenvandevelde/scikit-learn that referenced this pull request Jul 12, 2019
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pipeline should implement __len__

5 participants