code: def add_model_ss_lm(info_dict):
      """Adds model sum of squared errors to ``info_dict`` for linear models.
  
      Only sum of squared error 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_df_lm`.
  
      Returns
      -------
      info_dict : `dict`
          The information dictionary with the following keys added:
  
              "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.
      """
      residual = info_dict["residual"]
      weights = info_dict.get("weights")
      if weights is None:
          weights = np.eye(info_dict["n_sample"])
      y = info_dict["y"]
      y_pred = info_dict["y_pred"]
      y_mean = info_dict["y_mean"]
      info_dict["sse"] = residual.T @ weights @ residual
      info_dict["mse"] = info_dict["sse"] / info_dict["df_sse"]
      info_dict["ssr"] = (
          (y_pred - y_mean).T @ weights @ (y_pred - y_mean)
      )
      info_dict["msr"] = info_dict["ssr"] / info_dict["df_ssr"]
      info_dict["sst"] = (y - y_mean).T @ weights @ (y - y_mean)
      info_dict["mst"] = info_dict["sst"] / info_dict["df_sst"]
      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 6 for calling a global function with example usage: add_model_ss_lm(info_dict) and returns: info_dict