class_docstr: A class to store regression model summary statistics.
  
  The class can be printed to get a well formatted model summary.
  
  Attributes
  ----------
  x : `numpy.array`
      The design matrix.
  beta : `numpy.array`
      The estimated coefficients.
  y : `numpy.array`
      The response.
  pred_cols : `list` [ `str` ]
      List of predictor names.
  pred_category : `dict`
      Predictor category, returned by
      `~greykite.algo.common.col_name_utils.create_pred_category`.
  fit_algorithm : `str`
      The name of algorithm to fit the regression.
  ml_model : `class`
      The trained machine learning model class.
  max_colwidth : `int`
      The maximum length for predictors to be shown in their original name.
      If the maximum length of predictors exceeds this parameter, all
      predictors name will be suppressed and only indices are shown.
  info_dict : `dict`
      The model summary dictionary, output of
      `~greykite.algo.common.model_summary.ModelSummary._get_summary`
  html_str : `str`
      An html formatting of the string representation of the model summary.
class_docstr_tok: ["A","class","to","store","regression","model","summary","statistics",".","The","class","can","be","printed","to","get","a","well","formatted","model","summary",".","Attributes","--","--","--","--","--","x",":","`","numpy.array","`","The","design","matrix",".","beta",":","`","numpy.array","`","The","estimated","coefficients",".","y",":","`","numpy.array","`","The","response",".","pred_cols",":","`","list","`","[","`","str","`","]","List","of","predictor","names",".","pred_category",":","`","dict","`","Predictor","category",",","returned","by","`","~greykite.algo.common.col_name_utils.create_pred_category","`",".","fit_algorithm",":","`","str","`","The","name","of","algorithm","to","fit","the","regression",".","ml_model",":","`","class","`","The","trained","machine","learning","model","class",".","max_colwidth",":","`","int","`","The","maximum","length","for","predictors","to","be","shown","in","their","original","name",".","If","the","maximum","length","of","predictors","exceeds","this","parameter",",","all","predictors","name","will","be","suppressed","and","only","indices","are","shown",".","info_dict",":","`","dict","`","The","model","summary","dictionary",",","output","of","`","~greykite.algo.common.model_summary.ModelSummary._get_summary","`","html_str",":","`","str","`","An","html","formatting","of","the","string","representation","of","the","model","summary","."]
code: def __init__(
      self,
      x,
      y,
      pred_cols,
      pred_category,
      fit_algorithm,
      ml_model,  # needs to support cloning if ml_model implements a lasso method
      max_colwidth=20,
  ):
      # process x, beta and pred_cols to include the intercept term
      beta = getattr(ml_model, "coef_", None)
      intercept = getattr(ml_model, "intercept_", None)
      if beta is not None:
          x, beta, pred_cols = process_intercept(
              x, beta, intercept, pred_cols
          )
      self.x = x
      self.beta = beta
      self.y = y
      self.pred_cols = pred_cols
      self.pred_category = pred_category
      self.fit_algorithm = fit_algorithm
      self.ml_model = ml_model
      self.max_colwidth = max_colwidth
      self.info_dict = self._get_summary()
      self.html_str = f"<pre>{self.__str__()}</pre>"
  
file_path: greykite/greykite/algo/common/model_summary.py
imports: from greykite.algo.common.col_name_utils import filter_coef_summary
  from greykite.algo.common.model_summary_utils import format_summary_df
  from greykite.algo.common.model_summary_utils import get_info_dict_lm
  from greykite.algo.common.model_summary_utils import get_info_dict_tree
  from greykite.algo.common.model_summary_utils import print_summary
  from greykite.algo.common.model_summary_utils import process_intercept
label_desc: Use image node_id 1 to create a new ModelSummary object  with example: obj = ModelSummary(x, y, pred_cols, pred_category, fit_algorithm, ml_model, max_colwidth)