code: def pca_feature(
      df,
      memory_issues=False,
      mem_iss_component=False,
      variance_or_components=0.80,
      n_components=5,
      drop_cols=None,
      non_linear=True,
  ):
      if non_linear:
          pca = KernelPCA(
              n_components=n_components,
              kernel="rbf",
              fit_inverse_transform=True,
              random_state=33,
              remove_zero_eig=True,
          )
      else:
          if memory_issues:
              if not mem_iss_component:
                  raise ValueError(
                      "If you have memory issues, you have to preselect mem_iss_component"
                  )
              pca = IncrementalPCA(mem_iss_component)
          else:
              if variance_or_components > 1:
                  pca = PCA(n_components=variance_or_components)
              else:  # automted selection based on variance
                  pca = PCA(
                      n_components=variance_or_components,
                      svd_solver="full",
                  )
      if drop_cols:
          X_pca = pca.fit_transform(df.drop(drop_cols, axis=1))
          return pd.concat(
              (
                  df[drop_cols],
                  pd.DataFrame(
                      X_pca,
                      columns=[
                          "PCA_" + str(i + 1)
                          for i in range(X_pca.shape[1])
                      ],
                      index=df.index,
                  ),
              ),
              axis=1,
          )
  
      else:
          X_pca = pca.fit_transform(df)
          return pd.DataFrame(
              X_pca,
              columns=[
                  "PCA_" + str(i + 1) for i in range(X_pca.shape[1])
              ],
              index=df.index,
          )
  
      return df
  
file_path: deltapy/deltapy/mapper.py
imports: from sklearn.decomposition import PCA, IncrementalPCA, KernelPCA
  from sklearn.kernel_approximation import AdditiveChi2Sampler
  from sklearn.cross_decomposition import CCA
  from sklearn.manifold import LocallyLinearEmbedding
  from sklearn.preprocessing import minmax_scale
  from sklearn import datasets, cluster
  from sklearn.neighbors import NearestNeighbors
  import numpy
  import pandas
  import tensorflow
label_desc: Use image node_id 1 for calling a global function with example usage: pca_feature(df, memory_issues, mem_iss_component, variance_or_components, n_components, drop_cols, non_linear) and returns: df, pd, pd