code: def test_feature_names(self):
      data = np.random.randn(100, 5)
      target = np.array([0, 1] * 50)
  
      cases = [
          ["Feature1", "Feature2", "Feature3", "Feature4", "Feature5"],
          ["要因1", "要因2", "要因3", "要因4", "要因5"],
      ]
  
      for features in cases:
          dm = xgb.DMatrix(data, label=target, feature_names=features)
          assert dm.feature_names == features
          assert dm.num_row() == 100
          assert dm.num_col() == 5
  
          params = {
              "objective": "multi:softprob",
              "eval_metric": "mlogloss",
              "eta": 0.3,
              "num_class": 3,
          }
  
          bst = xgb.train(params, dm, num_boost_round=10)
          scores = bst.get_fscore()
          assert list(sorted(k for k in scores)) == features
  
          dummy = np.random.randn(5, 5)
          dm = xgb.DMatrix(dummy, feature_names=features)
          bst.predict(dm)
  
          # different feature name must raises error
          dm = xgb.DMatrix(dummy, feature_names=list("abcde"))
          self.assertRaises(ValueError, bst.predict, dm)
  
file_path: turicreate/src/external/xgboost/tests/python/test_basic.py
imports: import numpy
  import xgboost
  import unittest
  import matplotlib
label_desc: Use image node_id 3 for calling the TestBasic obj's underlying member method code with example usage: obj.test_feature_names() without return types