mattharrison / ml_pocket_reference

Resources for Machine Learning Pocket Reference
244 stars 137 forks source link

About Cell 28 of ch07.ipynb #1

Closed kiwi4py closed 4 years ago

kiwi4py commented 4 years ago

HI,Harrison Page 85 of your great book: you write "For example, to convert the Titanic survival column to a blend of posterior probability of the target and the prior probability given the title (categorical) information, use the following code:" but in Cell 28,you convert the Title column in the line te = ce.TargetEncoder(cols="Title"). 1) Do you mean to convert the Title column? 2) In this sentence, "the target" means survival? 3) "prior probability" means the probability of each kind of title's survival in the training data? Thanks.

mattharrison commented 4 years ago

This section is on categorical encoding. So encoding the Title with the eventual goal to add a numeric column with that data. 1-Yes 2-Yes notice in the .fit_transform call we pass in the survival column 3-Yes