I am constructing classification trees for the first time, so I'm quite new to this use of R.
I have observations of behaviours and incoming data that has to be classified as one of these behaviours. Using the rpart package, I was able to construct a tree:
Tree <- rpart(formula = behaviour ~., data=Tree.Data, method="class")
However, the behaviours I observed do not include all possible behaviours. For example I observed eating and sleeping, but not shaking. Now if my incoming data is actually shaking, I would prefer it to be classified as "unknown" rather than eating (as the best guess of the tree). Additionally, if the tree is not that certain of a prediction (less than 70% sure?), I would like it to be in this "unknown" class too.
I found that I can obtain the probabilities of each incoming datapoint being a certain behaviour:
pred <- predict(Tree, data = incoming.data[,c(behaviour)], type = c("prob"))
However, I do not know how to proceed...
Is there any way within the rpart package to do this? I also looked into Random Forest and thought I might be able to do something with the votes, but I got stuck on this too.
To clarify: I do not want to be able to classify unknown behaviours, I just want to put them on one big "unknown" pile.