No video

Get the feature names output by a ColumnTransformer

  Рет қаралды 8,636

Data School

Data School

Күн бұрын

Need to get the feature names output by a ColumnTransformer?
Use get_feature_names(), which now works with "passthrough" columns (new in version 0.23)!
👉 New tips every TUESDAY and THURSDAY! 👈
🎥 Watch all tips: • scikit-learn tips
🗒️ Code for all tips: github.com/jus...
💌 Get tips via email: scikit-learn.tips
=== WANT TO GET BETTER AT MACHINE LEARNING? ===
1) LEARN THE FUNDAMENTALS in my intro course (free!): courses.datasc...
2) BUILD YOUR ML CONFIDENCE in my intermediate course: courses.datasc...
3) LET'S CONNECT!
- Newsletter: www.dataschool...
- Twitter: / justmarkham
- Facebook: / datascienceschool
- LinkedIn: / justmarkham

Пікірлер: 10
@dataschool
@dataschool 2 жыл бұрын
Thanks for watching! 🙌 If you're new to ColumnTransformer, I recommend checking out tip #1: kzfaq.info/get/bejne/hK2ha9qfrZu6g6M.html
@Dara-lj8rk
@Dara-lj8rk 2 жыл бұрын
If I may suggest, it would be interesting to see the difference between pipeline inside a column transformer vs. a column transformer inside a pipeline. I personally always put CT inside a pipeline, so keen to know a use case for the other one.
@dataschool
@dataschool 2 жыл бұрын
You would put a Pipeline inside a ColumnTransformer any time you need to perform a sequence of transformations to the same column. Hope that helps!
@zeinat2233
@zeinat2233 2 жыл бұрын
this just saved me from a big headache
@dataschool
@dataschool 2 жыл бұрын
Great to hear!
@haitingyou6041
@haitingyou6041 Жыл бұрын
Hello, I want get the whole set of columns name including numerical, but with your method, it returned "Transformer num (type Pipeline) does not provide get_feature_names." Do you have any other suggestions?
@eatbreathedatascience9593
@eatbreathedatascience9593 2 жыл бұрын
oh, I didn't know that you can get the features names from the output. What's the different then if I were to do a df.columns of the output dataframe ? I still cannot get the idea of doing OHE and then do PCA on the output in a pipeline. Have you done a video on that already ? If not, could give some tips how to transform the output from the previous steps, like in the scenario I've described ? Thanks very much in advance.
@dataschool
@dataschool 2 жыл бұрын
The output of any scikit-learn transformer is not a DataFrame, so it doesn't have a columns attribute. Hope that helps!
@python2381
@python2381 2 жыл бұрын
hey i want one question and i want solution from you i have one arry like string ["4599"],["6625"],["7777"],["12345"],[7070] but i want print only this out put like this ["4599"],["6625"],["7777"] means i want print that string which string have same string last two or 1st and next if are same and or whole are same like in this arry ["7777"] how will sove this question
@dataschool
@dataschool 2 жыл бұрын
I'm not sure, sorry!
Load a toy dataset into a DataFrame
2:11
Data School
Рет қаралды 3,1 М.
Simplify Data Preprocessing with Python's Column Transformer: A Step-by-Step Guide
13:52
Zombie Boy Saved My Life 💚
00:29
Alan Chikin Chow
Рет қаралды 11 МЛН
Please Help Barry Choose His Real Son
00:23
Garri Creative
Рет қаралды 22 МЛН
Gli occhiali da sole non mi hanno coperto! 😎
00:13
Senza Limiti
Рет қаралды 17 МЛН
25 Nooby Pandas Coding Mistakes You Should NEVER make.
11:30
Rob Mulla
Рет қаралды 267 М.
This Is Why Python Data Classes Are Awesome
22:19
ArjanCodes
Рет қаралды 801 М.
Normalization Vs. Standardization (Feature Scaling in Machine Learning)
19:48
Use OrdinalEncoder instead of OneHotEncoder with tree-based models
6:59
Feature Selection in Python | Machine Learning Basics | Boston Housing Data
27:45
One Hot Encoder with Python Machine Learning (Scikit-Learn)
9:03
Ryan & Matt Data Science
Рет қаралды 17 М.
How to Build Your First Decision Tree in Python (scikit-learn)
15:13
Ryan & Matt Data Science
Рет қаралды 12 М.
Pandas for Data Science in 20 Minutes | Python Crash Course
23:06
Nicholas Renotte
Рет қаралды 121 М.