ageron / ageron/handson-ml3

[question] Chapter 3 exercise question 3:- redundant use of Encoder

Open
#236 1 comment 0 reactions 1 assignee Claimed by @ageron View on GitHub
question
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.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.