Questions tagged [rpart]

An R package for fitting classification and regression trees.

rpart is an package for fitting and trees ().

Repositories

Vignettes

Other resources

Related tags

415 questions
0
votes
1 answer

In the as.party function how can I clarify which are the indices for the different nodes?

After creating my CART with rpart I proceed to convert it to a party object with the as.party function from the partykit package. The subsecuent error appears: as.party(tree.hunterpb1) Error in partysplit(varid = which(rownames(obj$split)[j] ==…
Panchito
  • 307
  • 3
  • 11
0
votes
0 answers

control the number of splits of predictor variables while using rpart package

I am using the decision tree model for the first time in general and am not sure whether the output I got from running the tree is as expected. There are over 700 predictor variables available in the dataset. I used rpart package and issued the…
Shankar_m
  • 65
  • 1
  • 6
0
votes
1 answer

Interactions in CART

I am trying to tabulate a decision tree using Rpart. The code I am using is below so it can be copy pasted. ss <- 100 set.seed(123) x1 <- relevel(as.factor(sample(1:4,ss, replace=TRUE)), ref="4") x11 <- ifelse(x1==1,1,0) x12 <- ifelse(x1==2,1,0) x13…
0
votes
1 answer

rpart - how to define cp values to be cross-validated over

I am developing a regression model using the rpart function in R. This function cross-validates over the parameter cp. Is there a way to control what values of cp and how many are cross-validated over?
PT83
0
votes
2 answers

How to get rpart to work on relatively large number rows (~100k)?

I have a clustering need for my simple but a bit large data set. It has 3 columns and about 120k rows, plus all the data is numeric. I tried to use rpart but got this lovely error. Error in rep(1, numclass^2) : invalid 'times' argument In addition:…
berkorbay
  • 421
  • 7
  • 21
0
votes
1 answer

Classification tree that can fetch more than 1 prediction per observation

I'm searching for an algorythm from the classification trees algorythm familiy, that can provide a number (more than 1) of predicitions (in some ranked order) per observation. To be more specific - I have 10 binary target models to predict a target…
user3424107
  • 117
  • 1
  • 5
0
votes
1 answer

RPART - features types

RPART uses a different splitting procedure for continuous, ordinal and categorical variables. Is there a way to "inform" RPART about the variable type? For illustration, I have an ordinal variable with integer values (1,..,5). Right now, I need to…
Elad663
  • 704
  • 1
  • 5
  • 13
0
votes
1 answer

Numeric Comparison Precision in R; passing values between functions

After looking at this question: Numeric comparison difficulty in R I'm still stuck, because I'm depending on an equality comparison that is deep down in some function that I can't edit (or can I?) I test in a local environment whether three numbers…
RyanStochastic
  • 3,683
  • 4
  • 14
  • 22
0
votes
1 answer

rpart models collapse to zero splits in caret

I am using rpart to run a regression tree analysis within the caret package using the oneSE option for the selection function. When I do, I often end up with a model with zero splits. It suggests that no model would be better than any model. Should…
Guillemot
  • 1
  • 1
0
votes
1 answer

Parameters of a Decision Tree in R

Below is part of the output of a decision tree. Would like to know what does "yval" indicate node), split, n, deviance, yval * denotes terminal node 1) root 49381 732368600 38.23232 2) t1=NEG 7948 126010000 -22.73415 4)…
user1946217
  • 1,585
  • 6
  • 27
  • 37
0
votes
0 answers

In R build a tree and find the Cost of each branch

I am new to the R thing. I have been building this decision tree in TreeAge and it's OK. Now, i have this Tree here: I have this decision to make: A patient with Cancer / \ Cure…
r_alb
  • 1
  • 3
0
votes
1 answer

text rpart decision tree model -- how to suppress long list of values at each split node

I create a decision tree model with all categorical variables. Some of these categorical variables has over 100 possible values. Here is my code: model = rpart(score ~., data = dataset); plot(model) text(model) The problem is that text(model)…
user1369206
  • 1
  • 1
  • 1
0
votes
1 answer

rpart package issue in R 3.0.1 version

i am newbie to R i am using R 3.0.1 version, I have installed rpart package using install.packages("rpart") selected USA(CA 1) in the pop up box and it is installed successfully > p_data =…
Aj here
  • 47
  • 4
  • 14
0
votes
0 answers

Classification using decision trees in R

I am trying to classify my data using decision trees, the issue is the tree has no branches it has only root node. I do not understand the mistake. All the variables are set as factors (0/1) could any one find the mistake.. My code is as below …
0
votes
1 answer

Splitting rules in mvpart vs rpart

I would like to make classification trees to predict the presence/absence of 1 bird species based on several variables. I know that rpart handles univariate partitioning and mvpart handles multivariate partitioning, but I'd like to use mvpart for my…
1 2 3
27
28