code: def prediction_pipeline(model):
      r"""AlphaPy Prediction Pipeline
  
      Parameters
      ----------
      model : alphapy.Model
          The model object for controlling the pipeline.
  
      Returns
      -------
      None : None
  
      Notes
      -----
      The saved model is loaded from disk, and predictions are made
      on the new testing data.
  
      """
  
      logger.info("Predict Mode")
  
      # Unpack the model specifications
  
      directory = model.specs["directory"]
      drop = model.specs["drop"]
      feature_selection = model.specs["feature_selection"]
      model_type = model.specs["model_type"]
      rfe = model.specs["rfe"]
  
      # Get all data. We need original train and test for encodings.
  
      X_train, y_train = get_data(model, Partition.train)
  
      partition = Partition.predict
      X_predict, _ = get_data(model, partition)
  
      # Load feature_map
      model = load_feature_map(model, directory)
  
      # Log feature statistics
  
      logger.info("Feature Statistics")
      logger.info(
          "Number of Prediction Rows    : %d", X_predict.shape[0]
      )
      logger.info(
          "Number of Prediction Columns : %d", X_predict.shape[1]
      )
  
      # Apply transforms to the feature matrix
      X_all = apply_transforms(model, X_predict)
  
      # Drop features
      X_all = drop_features(X_all, drop)
  
      # Create initial features
      X_all = create_features(model, X_all, X_train, X_predict, y_train)
  
      # Generate interactions
      X_all = create_interactions(model, X_all)
  
      # Remove low-variance features
      X_all = remove_lv_features(model, X_all)
  
      # Load the univariate support vector, if any
  
      if feature_selection:
          logger.info("Getting Univariate Support")
          try:
              support = model.feature_map["uni_support"]
              X_all = X_all[:, support]
              logger.info("New Feature Count : %d", X_all.shape[1])
          except:
              logger.info("No Univariate Support")
  
      # Load the RFE support vector, if any
  
      if rfe:
          logger.info("Getting RFE Support")
          try:
              support = model.feature_map["rfe_support"]
              X_all = X_all[:, support]
              logger.info("New Feature Count : %d", X_all.shape[1])
          except:
              logger.info("No RFE Support")
  
      # Load predictor
      predictor = load_predictor(directory)
  
      # Make predictions
  
      logger.info("Making Predictions")
      tag = "BEST"
      model.preds[(tag, partition)] = predictor.predict(X_all)
      if model_type == ModelType.classification:
          model.probas[(tag, partition)] = predictor.predict_proba(
              X_all
          )[:, 1]
  
      # Save predictions
      save_predictions(model, tag, partition)
  
      # Return the model
      return model
  
imports: import warnings
  from alphapy.data import get_data
  from alphapy.data import sample_data
  from alphapy.data import shuffle_data
  from alphapy.estimators import get_estimators
  from alphapy.estimators import scorers
  from alphapy.features import apply_transforms
  from alphapy.features import create_crosstabs
  from alphapy.features import create_features
  from alphapy.features import create_interactions
  from alphapy.features import drop_features
  from alphapy.features import remove_lv_features
  from alphapy.features import save_features
  from alphapy.features import select_features
  from alphapy.frame import write_frame
  from alphapy.globals import CSEP, PSEP, SSEP, USEP
  from alphapy.globals import ModelType
  from alphapy.globals import Partition, datasets
  from alphapy.globals import WILDCARD
  from alphapy.model import first_fit
  from alphapy.model import generate_metrics
  from alphapy.model import get_model_config
  from alphapy.model import load_feature_map
  from alphapy.model import load_predictor
  from alphapy.model import make_predictions
  from alphapy.model import Model
  from alphapy.model import predict_best
  from alphapy.model import predict_blend
  from alphapy.model import save_model
  from alphapy.model import save_predictions
  from alphapy.optimize import hyper_grid_search
  from alphapy.optimize import rfecv_search
  from alphapy.plots import generate_plots
  from alphapy.utilities import get_datestamp
  import argparse
  from datetime import datetime
  import logging
  import numpy
  import os
  import pandas
  from sklearn.model_selection import train_test_split
  import sys
label_desc: Use image node_id 2 for calling a global function with example usage: prediction_pipeline(model) and returns: model