code: def rf_apply(X, model):
      return model.apply(X)
  
file_path: scikit-learn/examples/ensemble/plot_feature_transformation.py
imports: from sklearn.datasets import make_classification
  from sklearn.model_selection import train_test_split
  from sklearn.ensemble import GradientBoostingClassifier, RandomForestClassifier
  from sklearn.ensemble import RandomTreesEmbedding
  from sklearn.linear_model import LogisticRegression
  from sklearn.pipeline import make_pipeline
  from sklearn.preprocessing import FunctionTransformer, OneHotEncoder
  import matplotlib.pyplot
  from sklearn.metrics import RocCurveDisplay
label_desc: Use image node_id 1 for calling a global function with example usage: rf_apply(X, model) and returns: model