Domanda
Come trovare un esempio reale passo dopo passo di un albero di decisione per superare l'overfitting
Dare una risposta
Articoli simili
- Come è utile l'albero di Neem per l'uomo?
- Ha piovuto per 2 giorni subito dopo che il mio prato è stato aerato. Devo arieggiare di nuovo il prato?
- Quali sono i benefici di tenere un albero di neem in casa?
- Perché l'albero di Neem è considerato medicinale?
- Cosa tiene insieme un albero? C'è un adesivo attaccato alle fibre?
There is more than one way to perform pruning. The particular figure you have provided is an example of Quinlan's Reduced Error Pruning. Roughly this is how it works:
Because of 3, you need to proceed in a bottom up manner - so that if there is a subtree of S, say S', that can be replaced by a leaf, then it must be replaced by a leaf first - so that after replacement, S does not have any subtree with this property, and can go ahead and potentially replace S if needed.
In the diagram, note that the pruning happens bottom-up and left-to-right. Every node notes the number of samples it misclassifies in parenthesis. For ex in fig 3.3 (a), the node in marked in red misclasssifies one example from the pruning set:
Misclassified example in the pruning set:
Starting from the bottom its easy to see that node 3 can be made into a leaf since it makes lesser errors (on the pruning set) than as a subtree - as a subtree the classification happens at nodes 4 and 5, and 5 makes one error, node 3 by itself makes no errors. Same goes for 6 and 9. However, 2 cannot be made into a leaf since it makes one error, while as a subtree, with the newly-created leaves 3 and 6 it makes no errors.
Albero finale:
Per maggiori dettagli puoi consultare il documento Simplifying Decision Trees di Quinlan.