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
0
votes
0 answers

Need help to understand ctree plot warnings()

First time asking a question. I am relatively new to using R. Using it on a project for the Party package (cforest, ctree) which has no implementation in Python. I receive no warnings in my code until I plot a ctree, at which point I get a varying…
dumalo
  • 1
  • 1
0
votes
0 answers

How to customise a ctree (package 'party')?

So I have a problem using ctree in the R package party. I can't use the package partykit because it can't search for unordered splits in >= 31 levels I used this code: set.seed(1234) #To get reproducible result ind <-…
0
votes
1 answer

How to specify multiple splits in R-studio using classification tree- ctree?

I'm using 'ctree' for classification tree ( categorical response variable; New, Replace). I already got help from other available answers and forced the model to start splitting based on 'Year'. I have four independent variables (including 'Year").…
nahalh
  • 1
  • 2
0
votes
2 answers

Plot decision tree based on strings with J48 algorithm for prediction

I'm trying to plot J48 decision tree based on string values attributes and predict the target variable(categorical), I have seen many examples plotting decision tree based on numerical values but i haven't come across based on strings. Here is…
louis
  • 595
  • 3
  • 9
  • 24
0
votes
1 answer

partykit: regression tree - identify outliers in terminal node boxplots

The regression tree created using the code below has boxplots for all of the terminal nodes. The boxplots shows the median, IQR and outliers, which is great. plot(as.party(tree), terminal_panel = node_boxplot) But how do I identify the outliers in…
aleia
  • 59
  • 5
0
votes
1 answer

cforest in package party returning Inf for all predictions

I am trying to use the cforest function in the R package party to analyse some right-censored survival data. Every time I use the predict function I get Inf for each value, which means that a concordance index cannot be generated. My data can be…
panda
  • 821
  • 1
  • 9
  • 20
0
votes
0 answers

Creating models for each group in dataframe column in R

I would like to create a naiveBayes model per group of values of column TN. Here is the code: library(party) airq <- subset(airquality, !is.na(Ozone)) ct <- ctree(Ozone ~ ., data = airq, controls = ctree_control(maxsurrogate = 3)) airq$TN<-factor…
Avi
  • 2,247
  • 4
  • 30
  • 52
0
votes
1 answer

What is causing this error message when using the party package for a decision tree plot?

I am plotting a decision tree using the party package. When running the plot(tree) function, it plots the decision tree. However, I want to change the font size of the node labels and I am using the following…
user3115933
  • 4,303
  • 15
  • 54
  • 94
0
votes
1 answer

How do you use the partysplit function from partykit library to make a split with multiple factor levels in one child node

I am making a manual decision tree tool in R and am having trouble with categorical splits. For a table df below I want to make a split on the variable cat1 such that levels 1, 2, and 5 are in child 1 and levels 3, and 4 are in child 2 Is there a…
0
votes
0 answers

A chaotic decision tree with the "party" package

I'm trying to get a decision tree from the code: library(party) tree <- data.frame(mi[,-2]) levels(tree$OS_Gatunek) <- c("ta", "th", "tl", "to", "tp") # shortening species names model <- ctree(OS_Gatunek~., data=tree) plot(model) My data look like…
Olga Świder
  • 63
  • 1
  • 11
0
votes
0 answers

Weights in cforest 'tree' add up to more than sample size

This is my first time asking a question here so please be kind... and I apologise if this isn't the correct place to ask this question (the line between programming in R and a stats question can be a bit blurred to me) - if so I will happily try…
Izy
  • 101
  • 5
0
votes
1 answer

A function to display the result of rpart in party language in R language

I'd like to create a function to display the result of rpart with partykit. I converted the result of rpart with as.party with the following code and displayed the tree structure. library(partykit) library(rpart) result1 <- rpart(Species~.,data =…
0
votes
0 answers

R decision tree prediction

I have this…
bomberdini
  • 129
  • 1
  • 12
0
votes
1 answer

varimp (R partykit) retuns errors for conditional importance setting

Firstly, I constructed a model by cf1 <- cforest(y~., data = DATA, strata = DATA$y, ntree = 200L, mtry = 10) Here considering the dataset is very imbalanced (y=1 takes 7% of the whole observations), so I add strata here to make sure…
Bs He
  • 717
  • 1
  • 10
  • 22
0
votes
1 answer

partykit - Modify the terminal node of a boxplot to display y axis in the log scale

I am trying to plot a regression tree generated with rpart using partykit. The code that generates the tree is this one: library("rpart") fit <- rpart(Price ~ Mileage + Type + Country, cu.summary) library("partykit") tree.2 <-…
Alvaro GC
  • 46
  • 5