Why do we pop off the column?

Viewed 39
1 Answers

A feature is an input to the model; a label is the output from the model.

  • In your input data, a feature is one column of data.

  • This model is attempting to predict whether or not someone has survived; your input features could include 'class', 'deck', 'embark town', 'alone', and so on.

  • The last option is a label, such as 'survived' and thus the 'survived' column is removed.

After you've trained your model, you'll feed it new data with those features, and it'll return the predicted "label" 0(not survived) or 1(survived) for that person.

Related