0
$\begingroup$

I am fairly new to R and data mining concepts and am trying to understand the rpart package in R. I am a bit confused about the role of priors and loss in the making of a decision tree. I am referring to the http://cran.r-project.org/web/packages/rpart/vignettes/longintro.pdf document and would appreciate any explanation on this topic.

To be more specific , what does it mean by "prior probabilities of each class"? Does it mean that the tree has been built already and now we are trying to reduce the risk or loss?

$\endgroup$
0

1 Answer 1

1
$\begingroup$

I am going to assume that you understand what is meant by minimising loss. Otherwise you should look into a Statistics course.

Prior probabilities are useful in a branch of probability theory and statistics known as Bayesian Statistics. Simply put, the "prior probabilities of each class" are how likely you expect each class to be in the data.

A reasonable starting point for choosing your priors is to take a frequency based prior. If you have a validation set of data (where you know the true class for each of your samples) you can simply count the number of times each class appears, and divide it by the number of samples.

In other cases you may have more informed knowledge about how probable each class is in your data (maybe your own past experience, or from literature), in which case you should input that.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.