code: def dim_reduc(
      data,
      n_components: int,
      dim_method: str,
      apply_tsvd: bool = True,
      compute_backend=None,
  ):
      """Reduces the number of dimensions of the input data.
  
      Args:
          data: The dataframe
          n_components: Desired dimensionality for the data set prior to modeling
          dim_method: {'pca', 'ipca', 'tsne', 'tsvd'}
          - pca: Principal Component Analysis
          - ipca: Incremental Principal Component Analysis. Highly suggested for very large datasets
          - tsne: T-distributed Stochastic Neighbor Embedding
          - tsvd: Truncated Singular Value Decomposition
          apply_tsvd: If True, TSVD will be run before t-SNE. This is highly recommended when running t-SNE
  
      Returns:
          The dimensionally-reduced dataframe and reduction object
      """
      if not _is_dataframe(data):
          raise ValueError("Data must be a Pandas (or Modin) DataFrame")
  
      if dim_method == "pca":
          reduc_df, reductor = run_pca(
              data, n_components, compute_backend
          )
      elif dim_method == "ipca":
          reduc_df, reductor = run_ipca(
              data, n_components, compute_backend
          )
      elif dim_method == "tsne":
          reduc_df, reductor = run_tsne(
              data, n_components, apply_tsvd, compute_backend
          )
      elif dim_method == "tsvd":
          reduc_df, reductor = run_tsvd(
              data, n_components, compute_backend
          )
      else:
          raise NotImplementedError(
              "{} is not supported".format(dim_method)
          )
      return reduc_df, reductor
  
imports: import pandas
  import numpy
  from sklearn.decomposition import PCA, IncrementalPCA
  from sklearn.manifold import TSNE
  from sklearn.decomposition import TruncatedSVD
  from data_describe.compat import _is_dataframe, _compat, _requires
  from data_describe.backends._backends import _get_compute_backend
label_desc: Use image node_id 1 for calling a global function with example usage: dim_reduc(data, n_components, dim_method, apply_tsvd, compute_backend) and returns: reduc_df,  reductor