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

using column indices in the Custom Transformer #615

Open
julienvos opened this issue Jan 25, 2021 · 1 comment
Open

using column indices in the Custom Transformer #615

julienvos opened this issue Jan 25, 2021 · 1 comment

Comments

@julienvos
Copy link

In command line 68 and 69 of the projectcode of Chapter 2, the column indices of rooms_ix, bedrooms_ix, population_ix, household_ix are calculated using the whole 'housing' df. These column indices are later used in the custom Transformer.

Shouldn't this be the indices of the subset of the housing df that is used in the Columntransformer?

(For the current project it does't matter because indices are the same, but just for the conveniece and clearity)

Kind regards

@ageron
Copy link
Owner

ageron commented Mar 19, 2021

That's a great point, thanks @julienvos . The ColumnTransformer didn't exist when I wrote the book, so things were a bit ugly back then. You are right that we could just use a ColumnTransformer for this: it would be more elegant and more robust. Would you like to submit a PR?

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

2 participants