Obscure error while using refresh updater
- Dominant language
- C++
- Stars
- 28.8k
- Forks
- 8.9k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 54
Description
Hi, I have a xgboost model that I need to slightly fine tune for new datasets that it encounters, so I want to use the refresh updater (in python, via XGBClassifier object). However, I encounter an error that I do not understand:
```
XGBoostError Traceback (most recent call last)
in ()
35 experimental_explainer = shap.TreeExplainer(model_experimental)
36
---> 37 display(plot_contention(experiment_pred_data_con, experimental_explainer))
38 running = False
in plot_contention(df_to_plot, explainer)
231 # Normalize the data and drop some columns to calculate the shap values
232 tmp_df_shap = normalize_data(df_to_plot).drop(['timestamp', 'sid', 'Contention'], axis=1)
--> 233 shap_values = explainer.shap_values(tmp_df_shap)
234
235 # Dropdown menus for the plot to select the features and the System ID
~/.conda/envs/smfpy_dev/lib/python3.7/site-packages/shap/explainers/tree.py in shap_values(self, X, y, tree_limit, approximate, check_additivity)
213 phi = self.model.original_model.predict(
214 X, ntree_limit=tree_limit, pred_contribs=True,
--> 215 approx_contribs=approximate, validate_features=False
216 )
217 except ValueError as e:
~/.conda/envs/smfpy_dev/lib/python3.7/site-packages/xgboost/core.py in predict(self, data, output_margin, ntree_limit, pred_leaf, pred_contribs, approx_contribs, pred_interactions, validate_features)
1293 ctypes.c_uint(ntree_limit),
1294 ctypes.byref(length),
-> 1295 ctypes.byref(preds)))
1296 preds = ctypes2numpy(preds, length.value, np.float32)
1297 if pred_leaf:
~/.conda/envs/smfpy_dev/lib/python3.7/site-packages/xgboost/core.py in _check_call(ret)
176 """
177 if ret != 0:
--> 178 raise XGBoostError(_LIB.XGBGetLastError())
179
180
XGBoostError: b'\xd508:53:28\xe5 src/tree/tree_model.cc:300: Check failed: unique_path\xd5i\xe5.pweight == 0 (NaNQ(1) vs. 0) Unique path 4 must have zero weight\xf5\xf3z\xf2\xf8\xbd@\xa2\x99\x83a\xa3'
```
Here's the code:
```python
model_experimental = XGBClassifier(**{'colsample_bytree': 0.3, 'gamma': 0.0, 'max_depth': 8, 'min_child_weight': 7})
model_experimental.set_params(process_type = 'update', updater = 'refresh', refresh_leaf= True)
model_experimental.fit(experiment_x_pred_data_norm, contention_data['Contention'].values.ravel(), xgb_model = model.get_booster())
```
There might be several layers that instigated the problem, but I cannot start unraveling them until I understand what that means to be honest. First layer is that I am working in z/OS (IBM Mainframe), so the encoding is EBCDIC (I imagine that's the reason for byte encoding problems in the error itself).
xgboost version: 0.82
Sorry for the obscurity and thanks a lot in advance!
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.