Questions tagged [party]

Questions related to the R packages party and partykit for recursive partitioning

The R packages party and its successor partykit provide a toolbox for recursive partitioning for a variety of regression models. See the manual and vignettes for more details.

240 questions
4
votes
1 answer

R partykit::ctree offset labels on edges

I am working with ctree and my data set has a covariate of factors that create a node. There are enough factors for that covariate and their names are long enough that they overlap on each other in the edges created at the node. I want to find a way…
shea
  • 528
  • 4
  • 17
4
votes
2 answers

print decision tree in text nicely / with custom control [r]

I'd like to print a decision tree in text nicely. For example, I can print the tree object itself: library(rpart) f = as.formula('Sepal.Length ~ Sepal.Width + Petal.Length + Petal.Width + Species') fit = rpart(f, data = iris, control =…
YJZ
  • 3,934
  • 11
  • 43
  • 67
4
votes
1 answer

Make overfitting tree with maximum depth using ctree

When plotting a ctree model from partykit, I understand that it choose a default to prevent overfitting with overgrown trees. This default value sometimes results in an overly simple tree. To use a post-pruning technique I want to make an…
jardim
  • 43
  • 1
  • 4
4
votes
1 answer

GLMERTREE: Prevent clustered observations from being split among 2 terminal nodes

I have dataset where observations are taken repeatedly at 72 different sites. I'm using a lmertree model from the GLMERTREE package with a random intercept, a treatment variable, and many "partitioning" variables to identify whether there are…
Nick_89
  • 117
  • 2
  • 11
4
votes
2 answers

How to deal with large number of factors/categories within partykit

I use the partykit package and come across the following error message: Error in matrix(0, nrow = mi, ncol = nl) : invalid 'nrow' value (too large or NA) In addition: Warning message: In matrix(0, nrow = mi, ncol = nl) : NAs introduced by coercion…
Jakob Gepp
  • 463
  • 3
  • 10
4
votes
1 answer

How to change plot background of a ctree object in R?

I'm making a tree using the party package for a poster, and the background of the poster is grey. I've been able to change the background of all of my other plots (box plots, scatter plots) to grey by using the command par(bg = "grey") but this…
JGM
  • 43
  • 3
4
votes
1 answer

How to implement the output of decision tree built using the ctree (party package)?

I have built a decision tree using the ctree function via party package. it has 1700 nodes. Firstly, is there a way in ctree to give the maxdepth argument? I tried control_ctree option but, it threw some error message saying couldnt find ctree…
4
votes
3 answers

extracting predictors from ctree object

I've checked binary tree class methods, and How to extract tree structure from ctree function? (which was helpful understanding S4 object structure and slots), but it's still unclear how to get to the final predictors of a ctree object. For rpart,…
user2105469
  • 1,413
  • 3
  • 20
  • 37
4
votes
1 answer

Setting third party cookie by using 1x1 tag - Javascript doesn't drop cookie

I've been trying to set a third party cookie using the following method: SiteA SiteB