code: def main():
      # Train data from https://www.kaggle.com/c/allstate-claims-severity
      train = pd.read_csv("./train.csv")
      categorical_columns = train.select_dtypes(
          include=["object"]
      ).columns
  
      for column in tqdm(categorical_columns):
          le = LabelEncoder()
          train[column] = le.fit_transform(train[column])
  
      y = train["loss"]
  
      X = train.drop(["loss", "id"], 1)
      xgtrain = xgb.DMatrix(X, label=y)
  
      num_rounds = 3
      random_state = 2016
      params = {
          "eta": 0.1,
          "silent": 1,
          "eval_metric": "mae",
          "verbose_eval": True,
          "seed": random_state,
      }
      params["min_child_weight"] = args.min_child_weight
      params["max_depth"] = args.max_depth
      params["gamma"] = args.gamma
      params["alpha"] = args.alpha
  
      cv_result = xgb.cv(
          params,
          xgtrain,
          num_boost_round=num_rounds,
          nfold=5,
          seed=random_state,
          callbacks=[xgb.callback.early_stop(10)],
      )
  
      print(cv_result["test-mae-mean"].values[-1])
  
imports: import argparse
  from tqdm import tqdm
  import pandas
  import xgboost
  from sklearn.preprocessing import LabelEncoder
label_desc: Use image node_id 1 for calling a global function with example usage: main() without return types