Entropy to calculate information gain for decision tree for classification problems.
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi
I wonder whether Matlab has the function to calculate the entropy in order to calcuate the information gain for decision tree classification problems, or do I have to write my own entropy function for this purpose. It seems that the default entropy function in matlab is not for this purpose.
Example below:
![Decision_Tree_1.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/200540/Decision_Tree_1.png)
Without looking at any predictors, just calculate the entropy purely for the target. There are 9 'yes's and 5 'no's in the target. To calcuate the entropy, use the standard equation below. I wonder whether matlab has a function like this to calcuate the entropy?
![Picture1.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/200541/Picture1.png)
![Picture4.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/200542/Picture4.png)
0 commentaires
Réponses (0)
Voir également
Catégories
En savoir plus sur Classification Ensembles dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!