# Decision tree cp table

**URL:** <https://community.goactuary.com/t/decision-tree-cp-table/7522>\
**Category:** CAS MAS II\
**Created:** [March 11, 2023, 4:22am UTC](https://community.goactuary.com/t/decision-tree-cp-table/7522 "2023-03-11T04:22:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jerrytuttle](https://community.goactuary.com/user_avatar/community.goactuary.com/jerrytuttle/32/759_2.png) [@jerrytuttle](https://community.goactuary.com/u/jerrytuttle)\
**Post date:** [March 11, 2023, 4:22am UTC](https://community.goactuary.com/t/decision-tree-cp-table/7522/1 "2023-03-11T04:22:26Z")

</div>

Hi. Would someone please explain how to derive the numbers in the decision tree cp table, starting with the first cp value? Here is a simple example:

library(rpart)  
library(rpart.plot)  
#\> Warning: package ‘rpart.plot’ was built under R version 4.2.2  
df ← data.frame(x=c(1, 2, 3, 3, 3), y=c(0, 0, 1, 0, 1))  
model\<-rpart(y ~ x, data = df, method=“class”, minbucket = 1, minsplit=1, xval=5)  
summary(model)

![image](https://community.goactuary.com/uploads/default/original/3X/a/4/a4bfb39c41557467dc9a5e0b8ea01bb090035428.png)
