code: def _train(params, fpath, hyperopt=False):
      """
      :param params: hyperparameters. Its structure is consistent with how search space is defined. See below.
      :param fpath: Path or URL for the training data used with the model.
      :param hyperopt: Use hyperopt for hyperparameter search during training.
      :return: dict with fields 'loss' (scalar loss) and 'status' (success/failure status of run)
      """
      max_depth, max_features, n_estimators = params
      max_depth, max_features, n_estimators = (
          int(max_depth),
          float(max_features),
          int(n_estimators),
      )
  
      X_train, X_test, y_train, y_test = load_data(fpath)
  
      mod = RandomForestClassifier(
          max_depth=max_depth,
          max_features=max_features,
          n_estimators=n_estimators,
      )
  
      mod.fit(X_train, y_train)
      preds = mod.predict(X_test)
      acc = accuracy_score(y_test, preds)
  
      mlparams = {
          "max_depth": str(max_depth),
          "max_features": str(max_features),
          "n_estimators": str(n_estimators),
      }
      mlflow.log_params(mlparams)
  
      mlflow.log_metric("accuracy", acc)
  
      predictions = mod.predict(X_train)
      signature = infer_signature(X_train, predictions)
  
      mlflow.sklearn.log_model(mod, "saved_models", signature=signature)
  
      if not hyperopt:
          return mod
  
      return {"loss": acc, "status": STATUS_OK}
  
file_path: mlflow/examples/rapids/mlflow_project/src/rf_test/train.py
imports: import argparse
  from functools import partial
  from cuml.ensemble import RandomForestClassifier
  from cuml.metrics.accuracy import accuracy_score
  from cuml.preprocessing.model_selection import train_test_split
  from hyperopt import STATUS_OK, Trials, fmin, hp, tpe
  import mlflow
  import mlflow.sklearn
  from mlflow.models import infer_signature
label_desc: Use image node_id 2 for calling a global function with example usage: _train(params, fpath, hyperopt) and returns: dict, mod