Skip to content
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

Intercept column does not work properly with truncated indexes #152

Closed
janmotl opened this issue Oct 31, 2018 · 1 comment
Closed

Intercept column does not work properly with truncated indexes #152

janmotl opened this issue Oct 31, 2018 · 1 comment

Comments

@janmotl
Copy link
Collaborator

janmotl commented Oct 31, 2018

Intercept column sometimes contains nan:

    def test_truncated_index(self):
        data = pd.DataFrame(data={'x': ['A', 'B', 'C', 'A', 'B'], 'y': [1, 0, 1, 0, 1]})
        data = data.iloc[2:5]
        data2 = pd.DataFrame(data={'x': ['C', 'A', 'B'], 'y': [1, 0, 1]})
        for encoder_name in encoders.__all__:
            with self.subTest(encoder_name=encoder_name):
                enc = getattr(encoders, encoder_name)()
                result = enc.fit_transform(data.x, data.y)
                enc2 = getattr(encoders, encoder_name)()
                result2 = enc2.fit_transform(data2.x, data2.y)
                self.assertTrue((result.values == result2.values).all())
@janmotl
Copy link
Collaborator Author

janmotl commented Feb 11, 2019

Solved by @JohnnyC08 . Added test into test_encoders.

@janmotl janmotl closed this as completed Feb 11, 2019
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

No branches or pull requests

1 participant