AttributeError: 'XGBClassifier' object has no attribute 'enable_categorical'
buyske opened this issue · 2 comments
buyske commented
I appreciate the quick work on #8, but after pulling the latest version I've graduated to another problem
Inferring ancestry on query data...
/usr/local/lib/python3.9/site-packages/sklearn/base.py:209: FutureWarning: From version 0.24, get_params will raise an AttributeError if a parameter cannot be retrieved as an instance attribute. Previously it would return None.
warnings.warn('From version 0.24, get_params will raise an '
Traceback (most recent call last):
File "gnomix.py", line 383, in <module>
run_inference(base_args, model,
File "gnomix.py", line 55, in run_inference
y_proba_query = model.smooth.predict_proba(B_query)
File "src/Smooth/smooth.py", line 46, in predict_proba
proba = self.model.predict_proba(B_s)
File "/usr/local/lib/python3.9/site-packages/xgboost/sklearn.py", line 1348, in predict_proba
class_probs = super().predict(
File "/usr/local/lib/python3.9/site-packages/xgboost/sklearn.py", line 879, in predict
if self._can_use_inplace_predict():
File "/usr/local/lib/python3.9/site-packages/xgboost/sklearn.py", line 813, in _can_use_inplace_predict
not self.enable_categorical
AttributeError: 'XGBClassifier' object has no attribute 'enable_categorical'
buyske commented
Changing xgboost to 1.4.2 (from 1.5.0) seems to have done the trick.
weekend37 commented
Great! That's exactly what I would have suggested. Glad you solved it, marking as closed.
I really hope everything is now running smoothly for you but do let me know if something comes up.