Repository: modin-project/modin

Issue:
Modin XGBoost failed with `xgboost` version >=1.6.0
<!--
General questions should be asked on the mailing list modin-dev@googlegroups.com.

Before submitting an issue, please fill out the following form.
-->

### System information
- **OS Platform and Distribution (e.g., Linux Ubuntu 16.04)**: all
- **Modin version**: c46fb05221958e6100feea597a8aec02aa184775
- **Python version**: 3.8.13
- **Exact command to reproduce**:

<!--
You can obtain the Modin version with

python -c "import modin; print(modin.__version__)"
-->

```python
from sklearn import datasets

import ray
ray.init() # Start the Ray runtime for single-node

import modin.pandas as pd
import modin.experimental.xgboost as xgb

# Load iris dataset from sklearn
iris = datasets.load_iris()

# Create Modin DataFrames
X = pd.DataFrame(iris.data)
y = pd.DataFrame(iris.target)

# Create DMatrix
dtrain = xgb.DMatrix(X, y)
dtest = xgb.DMatrix(X, y)

# Set training parameters
xgb_params = {
    "eta": 0.3,
    "max_depth": 3,
    "objective": "multi:softprob",
    "num_class": 3,
    "eval_metric": "mlogloss",
}
steps = 20

# Create dict for evaluation results
evals_result = dict()

# Run training
model = xgb.train(
    xgb_params,
    dtrain,
    steps,
    evals=[(dtrain, "train")],
    evals_result=evals_result
)

# Print evaluation results
print(f'Evals results:\n{evals_result}')

# Predict results
prediction = model.predict(dtest)

# Print prediction results
print(f'Prediction results:\n{prediction}')
```
### Describe the problem
<!-- Describe the problem clearly here. -->

`xgboost.RabitTracker` API was changed in the latest release. Need to align codebase of Modin XGB with the latest release of xgb.

### Source code / logs
<!-- Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached. Try to provide a reproducible test case that is the bare minimum necessary to generate the problem. -->
```bash
Traceback (most recent call last):
  File "xgb_test.py", line 34, in <module>
    model = xgb.train(
  File "/home/prutskov/projects/modin/modin/experimental/xgboost/xgboost.py", line 424, in train
    result = _train(dtrain, params, *args, num_actors=num_actors, evals=evals, **kwargs)
  File "/home/prutskov/projects/modin/modin/experimental/xgboost/xgboost_ray.py", line 554, in _train
    with RabitContextManager(len(actors), get_node_ip_address()) as env:
  File "/home/prutskov/projects/modin/modin/experimental/xgboost/utils.py", line 41, in __init__
    self.rabit_tracker = xgb.RabitTracker(hostIP=host_ip, nslave=self._num_workers)
TypeError: __init__() got an unexpected keyword argument 'hostIP'
```



Discussion:

Resolving patch:
diff --git a/modin/experimental/xgboost/utils.py b/modin/experimental/xgboost/utils.py
--- a/modin/experimental/xgboost/utils.py
+++ b/modin/experimental/xgboost/utils.py
@@ -38,7 +38,9 @@ class RabitContextManager:
     def __init__(self, num_workers: int, host_ip):
         self._num_workers = num_workers
         self.env = {"DMLC_NUM_WORKER": self._num_workers}
-        self.rabit_tracker = xgb.RabitTracker(hostIP=host_ip, nslave=self._num_workers)
+        self.rabit_tracker = xgb.RabitTracker(
+            host_ip=host_ip, n_workers=self._num_workers
+        )
 
     def __enter__(self):
         """
@@ -51,7 +53,7 @@ def __enter__(self):
         dict
             Dict with Rabit Tracker environment.
         """
-        self.env.update(self.rabit_tracker.slave_envs())
+        self.env.update(self.rabit_tracker.worker_envs())
         self.rabit_tracker.start(self._num_workers)
         return self.env
 


Test patch:
diff --git a/modin/experimental/xgboost/test/test_dmatrix.py b/modin/experimental/xgboost/test/test_dmatrix.py
--- a/modin/experimental/xgboost/test/test_dmatrix.py
+++ b/modin/experimental/xgboost/test/test_dmatrix.py
@@ -134,8 +134,8 @@ def test_feature_weights():
         dm.get_float_info("feature_weights"), md_dm.get_float_info("feature_weights")
     )
     # Handle empty
-    dm.set_info(feature_weights=np.empty((0, 0)))
-    md_dm.set_info(feature_weights=np.empty((0, 0)))
+    dm.set_info(feature_weights=np.empty((0,)))
+    md_dm.set_info(feature_weights=np.empty((0,)))
 
     assert (
         dm.get_float_info("feature_weights").shape[0]