Question: How to work this formula in java? please share just the application of this formula using java preferably. Entropy value for any decision tree leaf

How to work this formula in java? please share just the application of this formula using java preferably.How to work this formula in java? please share just the application

Entropy value for any decision tree leaf node that has only two types of objects in it. The formula for the entropy value is : Entropy =-1 * ((P(Type I objects)) * log2(P(Type I objects)) + (P(Type II objects)) * log2(P(Type II objects))) The log2(n) is a negative number for probabilities, so that is the reason for multiplying the whole thing by -1. The log2(n) may be easy or difficult to find in any particular programming language. See the note below for a Java solution. Entropy value for any decision tree leaf node that has only two types of objects in it. The formula for the entropy value is : Entropy =-1 * ((P(Type I objects)) * log2(P(Type I objects)) + (P(Type II objects)) * log2(P(Type II objects))) The log2(n) is a negative number for probabilities, so that is the reason for multiplying the whole thing by -1. The log2(n) may be easy or difficult to find in any particular programming language. See the note below for a Java solution

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!