0
$\begingroup$

I am using rpart to classify the documents whether it belongs to class a or class b. I want to prove or provide reasons on what basis the document was classified correctly or wrongly. How can i do that?

I displayed the summary of the model. But it was not so convincing.

Please help

$\endgroup$
1
  • 1
    $\begingroup$ Your questions are legitimate but you need to put more effort in formulating them. What are you looking for, an expert user of the rpart library or an explanation on how to explain classifications in decision trees? The more effort you put in your question, the better the answers will be, and the more value it will create for the website. $\endgroup$ Oct 1, 2015 at 10:57

3 Answers 3

1
$\begingroup$

rpart is a decision tree model and as such is very much interpretable. You should visualize your decision tree. See the examples here, one of them is

enter image description here

Then for each given document you can follow the tree path and see

  • what were the features on the way responsible for the classification
  • what leaf your document arrived at and what is the percentage of correctly classified documents at these leaf.
$\endgroup$
0
$\begingroup$

In machine learning, we usually call "correctly" and "wrongly" as sensitivity, specificity, prediction accuracy etc. Please read this Wikipedia page for more details.

You can use hold a validation subset by cross-validation to validate your model.

$\endgroup$
0
$\begingroup$

This question on CrossValidated sort of answers your question. Rpart classifies via a decision tree, which means that if you could print the tree in one form or another it would be easy for you to take a document and see why it ended up being classified the way it was. The tree in itself is just a hierarchical set of rules applied to new documents.

The user was advised to use the rattle library which also uses decision trees but is able to print the set of rules induced by the tree, which should help you in your task.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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