human
Solve the following python programming problem given the following code:
# %load titanic.py
from sklearn.preprocessing import StandardScaler
import pandas as pd

def make_preprocesser(training_data):
    """
    Constructs a preprocessing function ready to apply to new dataframes.

    Crucially, the interpolating that is done based on the training data set
    is remembered so it can be applied to test datasets (e.g the mean age that
    is used to fill in missing values for 'Age' will be fixed based on the mean
    age within the training data set).

    Summary by column:

    ['PassengerId',
     'Survived',    # this is our target, not a feature
     'Pclass',      # keep as is: ordinal value should work, even though it's inverted (higher number is lower class cabin)
     'Name',        # omit (could try some fancy stuff like inferring ethnicity, but skip for now)
     'Sex',         # code to 0 / 1
     'Age',         # replace missing with median
     'SibSp',
     'Parch',
     'Ticket',      # omit (doesn't seem like low hanging fruit, could look more closely for pattern later)
     'Fare',        # keep, as fare could be finer grained proxy for socio economic status, sense of entitlement / power in getting on boat
     'Cabin',       # one hot encode using first letter as cabin as the cabin sector
     'Embarked']    # one hot encode

    Params:
        df: pandas.DataFrame containing the training data
    Returns:
        fn: a function to preprocess a dataframe (either before training or fitting a new dataset)
    """

    def pick_features(df):
        return df[['PassengerId', 'Pclass', 'Sex', 'Age', 'SibSp', 'Parch', 'Fare', 'Cabin', 'Embarked']]

    # save median Age so we can use it to fill in missing data consistently
    # on any dataset
    median_age_series = training_data[['Age', 'Fare']].median()

    def fix_missing(df):
        return df.fillna(median_age_series)

    def map_sex(df):
        df['Sex'] = df['Sex'].map({'male': 0, 'female': 1})
        return df

    def one_hot_cabin(df):
        def cabin_sector(cabin):
            if isinstance(cabin,...
Given the above code, generate some markdown instructions for it.
assistant
#Here is the Python program you requested.

I notice:
- Young children survive disproportionately
- There may be a correlation between fare and survivorship; those who pay more than the lowest value seem to survive disproportionately
- Those with no family aboard (either childeren via 'Parch' or siblings via 'SibSp') perish disproprotinately
So each of these variables seems worth keeping in our model.
Re-testing models against richer data
Now that I'm confident adding in the previously skipped variables 'Embarked' and the computed 'Cabin_Sector" could help, I think a good plan is to re-run the same models we tried last time is worth a shot. Here's the updated preprocessor helper function we'll use. Updates since last time:
- We include 'Embarked' and 'Cabin_sector' 
- Since both multiple non-ordinal values, we'll use one-hot encoding to flatten them out into one binary variable for each possible value, e.g embarked becomes embarked_from_C, embarked_from_Q, embarked_from_S
- We can handle missing values by setting the flattened out variable values to 0