Inferring the deck from the cabin

The cabin variable has three character values, where the first character corresponds to the Deck number (A, B, C, D, E). This is surely important information that we would like to extract.  We can do so with the following query:

SELECT cabin, substr(cabin, 1, 1) as deck  FROM titanic;

Get Effective Amazon Machine Learning now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.