Plot a correlation heatmap between every feature pair.

    Args:
        df: Pandas dataframe containing the target column (named 'target').
        features: The list of features to include in the correlation plot.
        font_size: Font size for heatmap cells and axis labels.
        figsize: The size of the plot.
        save_filename: (Optional) The path of the file to save a high-res version of the plot to.

def plot_feature_correlation_heatmap(df, features, font_size=9, figsize=(15, 15), save_filename=None):
    """
    Plot a correlation heatmap between every feature pair.

    Args:
        df: Pandas dataframe containing the target column (named 'target').
        features: The list of features to include in the correlation plot.
        font_size: Font size for heatmap cells and axis labels.
        figsize: The size of the plot.
        save_filename: (Optional) The path of the file to save a high-res version of the plot to.
    """

    features = features[:]
    features += ['target']

    mcorr = df[features].corr()
    mask = np.zeros_like(mcorr, dtype=np.bool)
    mask[np.triu_indices_from(mask)] = True

    cmap = sns.diverging_palette(220, 10, as_cmap=True)

    fig = plt.figure(figsize=figsize)
    heatmap = sns.heatmap(
        mcorr,
        mask=mask,
        cmap=cmap,
        square=True,
        annot=True,
        fmt='0.2f',
        annot_kws={'size': font_size},
    )

    heatmap.tick_params(axis='both', which='major', labelsize=font_size)
    heatmap.tick_params(axis='both', which='minor', labelsize=font_size)

    heatmap.set_xticklabels(features, rotation=90)
    heatmap.set_yticklabels(reversed(features))

    plt.show()

    if save_filename is not None:
        fig.savefig(save_filename, dpi=300)