1

I have been currently searching for a method to obtain the best fit α (significance level) for a Conditional Inference Tree model (using the party package) in RStudio. I have just realized I've been using the default value (α=0.05) for my model.

I've been searching everywhere for some code I could apply to get said α, but I can only find it for division trees, not for conditional inference (using ctree). Could someone help me and explain or write down an example I could apply to my model? Thank you very much in advance! Every bit of help is much appreciated!

Kiwi
  • 11
  • 3
  • Generally speaking you will have more success if you provide a *brief* example of what you have done (including example data). For your particular question the partykit package documentation shows how to change the alpha on page 25 under "New Features" https://cran.r-project.org/web/packages/partykit/vignettes/ctree.pdf – B Williams Apr 28 '23 at 23:20
  • Please provide enough code so others can better understand or reproduce the problem. – Community Apr 28 '23 at 23:21

1 Answers1

0

This can be tuned in the "usual" way, e.g., using cross-validation etc. There are a number of packages that facilitate such tuning tasks. One implementation that is particularly convenient for tuning the significance level in ctree() is caret. See the "Conditional Inference Tree" sections in: https://topepo.github.io/caret/train-models-by-tag.html#Accepts_Case_Weights.

Other packages that provide convenient general interfaces to ctree() include mlr3 or tidymodels.

Achim Zeileis
  • 15,710
  • 1
  • 39
  • 49
  • Thank you! But, I've been trying to set up the training samples, and I'm not able to do so. Would you happen to know a guide/example of R code where Conditional Inference Trees' α value is obtained through the caret package? Again, thank you for responding, and sorry for the insistence! – Kiwi May 02 '23 at 11:40