Interaction constraint



I tried testing interaction constraint feature from command line arguments.

added below args to the basic args -
interaction_constraints= ‘[[2,3,4],[6,7,8]]’

But got runtime error “InteractionConstraint must be given an inner evaluator”

Please guide me, what is inner evaluator I should provide for executing interaction constraint feature.

I have used basic args as following:

booster=gbtree task=train
nthread=50 num_round=5 max_depth=3 learning_rate=0.1 min_child_weight=20
reg_lambda=0 min_split_loss=0 objective=binary:logistic


Please remove split_evaluator from your CLI configuration, since the interaction constraints are enabled by default:


I tried removing split_evaluator and built model.
I found that the model built with interaction constraint and without interaction constraint, both are exactly same.

It looks like the constraint is not enforced while given parameter as interaction_constraints= ‘[[2,3,4],[6,7,8]]’ in command line.

Let me know if I am missing anything here.
Thanks for your response.


I don’t think we actually tested interaction constraints for CLI. Try using Python?


I tried testing with python api and it is working as expected.

Thanks a lot for your response.
I will check the command-line and try to fix it.