code: def test_regression(boston_dataframe, return_train_score):
      # loading dataset
      assert isinstance(boston_dataframe, pd.DataFrame)
  
      # init setup
      pycaret.regression.setup(
          boston_dataframe,
          target="medv",
          remove_multicollinearity=True,
          multicollinearity_threshold=0.95,
          log_experiment=True,
          html=False,
          session_id=123,
          n_jobs=1,
          experiment_name=uuid.uuid4().hex,
      )
  
      # compare models
      top3 = pycaret.regression.compare_models(
          n_select=100,
          exclude=["catboost"],
          errors="raise",
      )[:3]
      assert isinstance(top3, list)
  
      # tune model
      tuned_top3 = [
          pycaret.regression.tune_model(
              i, n_iter=3, return_train_score=return_train_score
          )
          for i in top3
      ]
      assert isinstance(tuned_top3, list)
  
      pycaret.regression.tune_model(
          top3[0],
          n_iter=3,
          choose_better=True,
          return_train_score=return_train_score,
      )
  
      # ensemble model
      bagged_top3 = [
          pycaret.regression.ensemble_model(
              i, return_train_score=return_train_score
          )
          for i in tuned_top3
      ]
      assert isinstance(bagged_top3, list)
  
      # blend models
      pycaret.regression.blend_models(
          top3, return_train_score=return_train_score
      )
  
      # stack models
      pycaret.regression.stack_models(
          estimator_list=top3[1:],
          meta_model=top3[0],
          return_train_score=return_train_score,
      )
  
      # plot model
      lr = pycaret.regression.create_model(
          "lr", return_train_score=return_train_score
      )
      pycaret.regression.plot_model(
          lr, save=True
      )  # scale removed because build failed due to large image size
  
      # select best model
      pycaret.regression.automl(optimize="MAPE", use_holdout=True)
      best = pycaret.regression.automl(optimize="MAPE")
  
      # hold out predictions
      predict_holdout = pycaret.regression.predict_model(best)
      assert isinstance(predict_holdout, pd.DataFrame)
  
      # predictions on new dataset
      predict_holdout = pycaret.regression.predict_model(
          best, data=boston_dataframe
      )
      assert isinstance(predict_holdout, pd.DataFrame)
  
      # finalize model
      pycaret.regression.finalize_model(best)
  
      # save model
      pycaret.regression.save_model(best, "best_model_23122019")
  
      # load model
      pycaret.regression.load_model("best_model_23122019")
  
      # returns table of models
      all_models = pycaret.regression.models()
      assert isinstance(all_models, pd.DataFrame)
  
      # get config
      X_train = pycaret.regression.get_config("X_train")
      X_test = pycaret.regression.get_config("X_test")
      y_train = pycaret.regression.get_config("y_train")
      y_test = pycaret.regression.get_config("y_test")
      assert isinstance(X_train, pd.DataFrame)
      assert isinstance(X_test, pd.DataFrame)
      assert isinstance(y_train, pd.Series)
      assert isinstance(y_test, pd.Series)
  
      # set config
      pycaret.regression.set_config("seed", 124)
      seed = pycaret.regression.get_config("seed")
      assert seed == 124
  
      assert 1 == 1
  
file_path: pycaret/tests/test_regression.py
imports: import uuid
  import numpy
  import pandas
  import pytest
  from mlflow.tracking import MlflowClient
  import pycaret.datasets
  import pycaret.regression
label_desc: Use image node_id 2 for calling a global function with example usage: test_regression(boston_dataframe, return_train_score) without return types