code: def train_model(dataset_id: str, training_args: dict):
      print("starting train_model")
      from clearml import Dataset, OutputModel, Task
      from pathlib import Path
      import pandas as pd
      import numpy as np
      import xgboost as xgb
      from sklearn.model_selection import train_test_split
      import matplotlib.pyplot as plt
  
      dataset = Dataset.get(dataset_id=dataset_id)
      local_folder = dataset.get_local_copy()
      df = pd.read_csv(Path(local_folder) / "dataset.csv")
  
      # prepare data (i.e. select specific columns)
      columns = [
          "age",
          "fnlwgt",
          "education-yrs",
          "capital-gain",
          "capital-loss",
          "hours-per-week",
      ]
      X = df[columns].drop("age", axis=1)
      y = df["age"]
      X_train, X_test, y_train, y_test = train_test_split(
          X, y, test_size=0.2, random_state=42
      )
      # create matrix
      dtrain = xgb.DMatrix(X_train, label=y_train)
      dtest = xgb.DMatrix(X_test, label=y_test)
  
      # train with XGBoost
      params = {"objective": "reg:squarederror", "eval_metric": "rmse"}
      bst = xgb.train(
          params,
          dtrain,
          num_boost_round=training_args.get("num_boost_round", 100),
          evals=[(dtrain, "train"), (dtest, "test")],
          verbose_eval=0,
      )
      # evaluate
      y_pred = bst.predict(dtest)
      plt.plot(y_test, "r")
      plt.plot(y_pred, "b")
  
      # let's store the eval score
      error = np.linalg.norm(y_test - y_pred)
      bst.save_model("a_model.xgb")
  
      Task.current_task().reload()
      model_id = Task.current_task().models["output"][-1].id
      print("done train_model")
      return dict(error=error, model_id=model_id)
  
imports: from clearml import PipelineDecorator, Task
label_desc: Use image node_id 4 for calling a global function with example usage: train_model(dataset_id, training_args) and returns: dict