code: def add_model_significance_lm(info_dict):
      """Adds model significance metrics to `info_dict` for linear models.
  
      Only model significance metrics information will be added in this function.
      A series of these functions are used in a flow to get all information needed
      in linear model summary. The flow is
      `~greykite.algo.common.model_summary_utils.create_info_dict_lm`,
      `~greykite.algo.common.model_summary_utils.add_model_params_lm`,
      `~greykite.algo.common.model_summary_utils.add_model_df_lm`,
      `~greykite.algo.common.model_summary_utils.add_model_ss_lm`,
      `~greykite.algo.common.model_summary_utils.add_beta_var_lm`,
      `~greykite.algo.common.model_summary_utils.add_model_coef_df_lm`,
      `~greykite.algo.common.model_summary_utils.add_model_significance_lm`.
      For flow implementation, see
      `~greykite.algo.common.model_summary_utils.get_info_dict_lm`.
  
      Parameters
      ----------
      info_dict : `dict`
          The information dictionary returned by
          `~greykite.algo.common.model_summary_utils.add_model_coef_df_lm`.
  
      Returns
      -------
      info_dict : `dict`
          The information dictionary with the following keys added:
  
              "f_value" : `float`
                  The F-ratio for model significance.
                  Defined as ``msr / mse``
              "f_p_value" : `float`
                  The p-value of F-ratio using degrees of freedom
                  ``df_ssr`` and ``df_sse``.
              "r2" : `float`
                  The coefficient of determination.
                  Defined as ``ssr / sst``
              "r2_adj" : `float`
                  The adjusted coefficient of determination.
                  Defined as ``msr / mst``
              "aic" : `float`
                  The AIC of model, with the constants depending only on
                  ``n_sample`` removed.
              "bic" : `float`
                  The BIC of model, with the constants depending only on
                  ``n_sample`` removed.
      """
      # Gets F-value and its p-value
      info_dict["f_value"] = info_dict["msr"] / info_dict["mse"]
      info_dict["f_p_value"] = 1 - f.cdf(
          info_dict["f_value"], info_dict["df_ssr"], info_dict["df_sse"]
      )
      # Gets R^2 and adjusted R^2
      info_dict["r2"] = 1 - info_dict["sse"] / info_dict["sst"]
      info_dict["r2_adj"] = 1 - info_dict["mse"] / info_dict["mst"]
      # Gets AIC and BIC
      if info_dict["fit_algorithm"] == "statsmodels_glm":
          info_dict["aic"] = info_dict["ml_model"].aic
          info_dict["bic"] = info_dict["ml_model"].bic
      else:
          info_dict["aic"] = 2 * info_dict["reg_df"] + info_dict[
              "n_sample"
          ] * np.log(
              info_dict["sse"]
          )  # Ignores the constants
          info_dict["bic"] = np.log(info_dict["n_sample"]) * info_dict[
              "reg_df"
          ] + info_dict["n_sample"] * np.log(
              info_dict["sse"]
          )  # Ignores the constants
      return info_dict
  
imports: import numpy
  import pandas
  import statsmodels
  import statsmodels.api
  from scipy.stats import f
  from scipy.stats import norm
  from scipy.stats import t
  from sklearn.base import clone
  from sklearn.linear_model import Ridge
  from sklearn.model_selection import train_test_split
  from greykite.algo.common.col_name_utils import INTERCEPT
  from greykite.algo.common.col_name_utils import simplify_pred_cols
label_desc: Use image node_id 17 for calling a global function with example usage: add_model_significance_lm(info_dict) and returns: info_dict