# XGBoost is it possible to prevent a feature from being used twice in the same tree?

I'm using XGBoost and all its doing is using the feature in the first column of my data. My feature importance chart correlates perfectly to the position of the feature in my xtrain. If I shuffle the columns in xtrain, the feature chart changes along witht he shuffle after re-running the model.

This suggests that XGBoost is "getting stuck" on the first feature. Is there a way to prevent this? I was thinking by limiting how many times the same feature can appear in a tree?

• I don't think trying to force xgb to limit usage of a feature is the right approach here. If it always focuses on the first feature regardless of what that feature actually is, you've got a serious bug. – Ben Reiniger Jun 20 at 1:02
• What happens if you fit a decision tree and you plot it? What do you see? – Carlos Mougan Jun 20 at 6:59

model = XGBClassifier(max_depth=n)