[question] Chapter 3 exercise question 3:- redundant use of Encoder
- Dominant language
- Jupyter Notebook
- Stars
- 14.1k
- Forks
- 5.3k
- PR merge metrics
- No merged PRs in 30d
Description
### Enter the chapter number
Chapter 3
### Enter the page number
129
### What is the cell's number in the notebook
116
### Enter the environment you are using to run the notebook
Colab
### Question
Hi, I was doing the exercises in Chapter 3, and while going through the provided solution for question 3 : Tackle the Titanic dataset, I found that in cell 116 there are two encoders used. I tried using only one encoder, and it gave me the same result. I would like to know if there is any reason for this.
```
cat_pipeline = Pipeline([
("ordinal_encoder", OrdinalEncoder()),
("imputer", SimpleImputer(strategy="most_frequent")),
("cat_encoder", OneHotEncoder(sparse_output=False)),
])
```
I use the following code and it gave me the same result
```
cat_pipeline = Pipeline([
("imputer", SimpleImputer(strategy="most_frequent")),
("cat_encoder", OneHotEncoder(sparse_output=False)),
])
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.