Specify list of iteration/tree indices to use in prediction

Looking at the predict documentation I saw the iteration_range functionnality. Was wondering if it is possible to pass a list of indices to use in prediction instead of a range. Say for example, I don’t want trees [3, 5, 15, …] to affect the prediction? But I want [1, 2, 4, … ] to be in it…

More details on my use case… There are features I want in training but not at inference. So I’ve put interaction constraints so that these features don’t interact with the other ones I want at inference. Using trees_to_dataframe I’m able to extract a list of indices that used the features I don’t want affecting the predictions at inference. Now I’d like a way to predict without these tree indices…

Tried editing the json of the booster to manually remove them but can’t seem to make it work. Was wondering if there is any other way?