code: def get_info_dict_lm(x, y, beta, ml_model, fit_algorithm, pred_cols):
      """Get the ``info_dict`` dictionary for linear models.
  
      A series of 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`.
  
      Parameters
      ----------
      x : `numpy.array`
          The design matrix.
      y : `numpy.array`
          The response vector.
      beta : `numpy.array`
          The estimated coefficients.
      ml_model : `class`
          The trained machine learning model class, see
          `~greykite.algo.common.ml_models.fit_model_via_design_matrix`.
      fit_algorithm : `str`
          The name of fit algorithm, see
          `~greykite.algo.common.ml_models.fit_model_via_design_matrix`.
      pred_cols : `list` [ `str` ]
          A list of predictor names.
  
      Returns
      -------
      info_dict : `dict`
          The dictionary of linear model summary information with the following keys:
  
              "x" : `numpy.array`
                  The design matrix.
              "y" : `numpy.array`
                  The response vector.
              "beta" : `numpy.array`
                  The estimated coefficients.
              "ml_model" : `class`
                  The trained machine learning model class, see
                  `~greykite.algo.common.ml_models.fit_model_via_design_matrix`
              "fit_algorithm" : `str`
                  The name of fit algorithm, see
                  `~greykite.algo.common.ml_models.fit_model_via_design_matrix`
              "pred_cols" : `list` [ `str` ]
                  A list of predictor names.
              "degenerate_index" : `numpy.array`
                  The indices where the x columns are degenerate.
              "n_sample" : `int`
                  Number of observations.
              "n_feature" : `int`
                  Number of features.
              "nonzero_index" : `numpy.array`
                  Indices of nonzero coefficients.
              "n_feature_nonzero" : `int`
                  Number of nonzero coefficients.
              "y_pred" : `numpy.array`
                  The predicted values.
              "y_mean" : `float`
                  The mean of response.
              "residual" : `numpy.array`
                  Residuals.
              "residual_summary" : `numpy.array`
                  Five number summary of residuals.
              "model" : `str`
                  The model name.
              "weights" : `numpy.array`, optional
                  The weight matrix.
              "family" : `str`, optional
                  The distribution family in generalized linear model.
              "link_function" : `str`, optional
                  The link function used in generalized linear model.
              "alpha" : `float`, optional
                  The regularization parameter in regularized methods.
              "l1_ratio" : `float`, optional
                  The l1 norm ratio in Elastic Net methods.
              "x_nz" : `numpy.array`
                  The design matrix with columns corresponding to nonzero estimated coefficients.
              "condition_number" : `float`
                  The condition number for sample covariance matrix (weighted, adjusted).
              "xtwx_alphai_inv" : `numpy.array`
                  (X'WX+a*I)^-1
              "reg_df" : `float`
                  The regression degree of freedom, defined as the trace of hat matrix.
              "df_sse" : `float`
                  The degree of freedom of residuals, defined as n_sample - reg_df.
              "df_ssr" : `float`
                  The degree of freedom of the regression, defined as reg_df - 1.
              "df_sst" : `int`
                  The degree of freedom of total, defined as n_sample - 1.
              "sse" : `float`
                  Sum of squared errors from residuals.
              "mse" : `float`
                  ``sse`` divided by its degree of freedom.
              "ssr" : `float`
                  Sum of squared errors from regression.
              "msr" : `float`
                  ``ssr`` divided by its degree of freedom.
              "sst" : `float`
                  Sum of squared errors from total.
              "mst" : `float`
                  ``sst`` divided by its degree of freedom.
              "beta_var_cov" : `numpy.array`
                  The covariance matrix of estimated coefficients. The squared root of
                  its diagonal elements are standard errors of the estimated coefficients.
                  Set as ``None`` for sparse solutions.
              "coef_summary_df" : `pandas.DataFrame`
                  The summary df for estimated coefficients.
              "significance_code_legend" : `str`, optional
                  The significance code legend.
              "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.
              "model_type" : `str`
                  Equals "lm".
      """
      info_dict = create_info_dict_lm(
          x, y, beta, ml_model, fit_algorithm, pred_cols
      )
      info_dict = add_model_params_lm(info_dict)
      info_dict = add_model_df_lm(info_dict)
      info_dict = add_model_ss_lm(info_dict)
      info_dict = add_beta_var_lm(info_dict)
      info_dict = add_model_coef_df_lm(info_dict)
      info_dict = add_model_significance_lm(info_dict)
      info_dict["model_type"] = "lm"
      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 18 for calling a global function with example usage: get_info_dict_lm(x, y, beta, ml_model, fit_algorithm, pred_cols) and returns: info_dict