E-Learning-App | Online learning app for students | Learning library
kandi X-RAY | E-Learning-App Summary
kandi X-RAY | E-Learning-App Summary
Online learning app for students
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of E-Learning-App
E-Learning-App Key Features
E-Learning-App Examples and Code Snippets
Community Discussions
Trending Discussions on E-Learning-App
QUESTION
I'm going through the jupyter notebooks from the book Hand-On ML with scikit-learn. I'm trying to do the Titanic challenge but using the ColumnTransformer.
I'm trying to create the pre-processing pipeline, for numerical values the ColumnTransformer produces the right output. However, when working with the categorical values I'm getting a weird output.
Here's the code:
...ANSWER
Answered 2022-Feb-28 at 02:28Expanding on the comment, the columns you give as the third tuple elements to ColumnTransformer
should partition the entire set of columns in your dataframe.
If some columns are repeated, as you have experienced, this messes up the results.
If some columns are omitted, they are left out from the output of ColumnTransformer
.
For example, say that your dataframe has categorical columns cat_attr
and numeric columns num_attr
.
You want to apply two transformations (SimpleImputer
and OneHotEncoder
) to the categorical columns and no transformation to the numeric columns.
In this case the correct approach is:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install E-Learning-App
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page