def create_warning_section(info_dict):
    """Creates the warning section for model summary.

    The following warnings are possible to be included:

        Condition number is too big.
        F-ratio and p-value on regularized methods.
        R-squared and F-ratio in glm.
        Zero coefficients in non-sparse regression methods due to degenerate columns.

    Parameters
    ----------
    info_dict : `dict`
        The dictionary returned by
        `~greykite.algo.common.model_summary_utils.get_info_dict_lm`.
        or
        `~greykite.algo.common.model_summary_utils.get_info_dict_tree`.

    Returns
    -------
    content : `str`
        The model warnings section.
    """
    if info_dict["model_type"] == "lm":
        content = ""
        if info_dict["condition_number"] > 1000:
            content += f"WARNING: the condition number is large, {'{:.2e}'.format(info_dict['condition_number'])}. " \
                       f"This might indicate that there are strong multicollinearity " \
                       f"or other numerical problems."
            content += "\n"
        if info_dict["fit_algorithm"] in ["ridge", "lasso", "lars", "lasso_lars",
                                          "sgd", "elastic_net"]:
            content += "WARNING: the F-ratio and its p-value on regularized methods might be misleading, " \
                       "they are provided only for reference purposes."
            content += "\n"
        if info_dict["fit_algorithm"] in ["statsmodels_glm"]:
            content += "WARNING: the R-squared and F-statistics on glm might be misleading, " \
                       "they are provided only for reference purposes."
            content += "\n"
        if (len(info_dict["nonzero_index"]) < info_dict["n_feature"]
            and
            info_dict["fit_algorithm"] in ["linear", "ridge", "statsmodels_ols",
                                           "statsmodels_wls", "statsmodels_gls",
                                           "statsmodels_glm"]):
            content += "WARNING: the following columns have estimated coefficients equal to zero, " \
                       f"while {info_dict['fit_algorithm']} is not supposed to have zero estimates. " \
                       f"This is probably because these columns are degenerate in the design matrix. " \
                       f"Make sure these columns do not have constant values." + "\n" +\
                       f"{[col for i, col in enumerate(info_dict['pred_cols']) if i not in info_dict['nonzero_index']]}"
            content += "\n"
        if len(info_dict["degenerate_index"]) > 1:
            content += "WARNING: the following columns are degenerate, do you really want to include them in your model? " \
                       "This may cause some of them to show unrealistic significance. Consider using the `drop_degenerate` transformer." + "\n" +\
                       f"{[col for i, col in enumerate(info_dict['pred_cols']) if i in info_dict['degenerate_index']]}"
            content += "\n"
        if content == "":
            content = None
    else:
        content = None
    return content