"
# Create a binary mask that indicates which values are missing
def apply_mask(df):
    {your code here}
    {you can return whatever you want here}

# Convert categorical data to numeric using Embedding Encoding
def categorical_to_numerical(df):

    # Loop over categorical columns
    for col in cat_cols:
        {your code here}

    return df
"

Make function to apply a mask on a dataframe that rankes the null values lower so its weight will be less than the original none null values when imputing them
Using embedding encoding, convert categorical values to numerical values so they can be used to impute missing values with xgboost later.
The categorical_to_numerical() function should take in consideration the null values

TLDR;
1: Make the function that applies a mask on the dataframe to rank the null values that will be imputed lower than the non-null values.
2: Finish the function to convert categorical masked data to numeric using embedding encoding.
3: Use the apply_mask() function in the categorical_to_numerical() function if it will help rank missing values lower.
4: YOU SHOULD USE EMBEDDING ENCODING/WORD EMBEDDING (AND NOT LABEL ENCODING) TO CONVERT THE CATEGORICAL VALUES TO NUMERICAL VALUES.

