code: def get_model_results_summary(result):
      """Generates model results summary.
  
      Parameters
      ----------
      result : `ForecastResult`
          See :class:`~greykite.framework.pipeline.pipeline.ForecastResult` for documentation.
  
      Returns
      -------
      Prints out model coefficients, cross-validation results, overall train/test evalautions.
      """
      # Get the useful fields from the forecast result
      model = result.model[-1]
      backtest = result.backtest
      grid_search = result.grid_search
  
      # Check model coefficients / variables
      # Get model summary with p-values
      print(model.summary())
  
      # Get cross-validation results
      cv_results = summarize_grid_search_results(
          grid_search=grid_search,
          decimals=2,
          cv_report_metrics=None,
          column_order=[
              "rank",
              "mean_test",
              "split_test",
              "mean_train",
              "split_train",
              "mean_fit_time",
              "mean_score_time",
              "params",
          ],
      )
      # Transposes to save space in the printed output
      print(
          "================================= CV Results =================================="
      )
      print(cv_results.transpose())
  
      # Check historical evaluation metrics (on the historical training/test set).
      backtest_eval = defaultdict(list)
      for metric, value in backtest.train_evaluation.items():
          backtest_eval[metric].append(value)
          backtest_eval[metric].append(backtest.test_evaluation[metric])
      metrics = pd.DataFrame(backtest_eval, index=["train", "test"]).T
      print(
          "=========================== Train/Test Evaluation ============================="
      )
      print(metrics)
  
file_path: greykite/docs/nbpages/tutorials/0300_weekly_data.py
imports: import warnings
  from collections import defaultdict
  import plotly
  import pandas
  from greykite.common.constants import TIME_COL
  from greykite.common.constants import VALUE_COL
  from greykite.framework.benchmark.data_loader_ts import DataLoader
  from greykite.framework.input.univariate_time_series import UnivariateTimeSeries
  from greykite.framework.templates.autogen.forecast_config import EvaluationPeriodParam
  from greykite.framework.templates.autogen.forecast_config import ForecastConfig
  from greykite.framework.templates.autogen.forecast_config import MetadataParam
  from greykite.framework.templates.autogen.forecast_config import ModelComponentsParam
  from greykite.framework.templates.forecaster import Forecaster
  from greykite.framework.utils.result_summary import summarize_grid_search_results
label_desc: Use image node_id 1 for calling a global function with example usage: get_model_results_summary(result) without return types