Decision Tree Example

    Example of Decision Tree

Let’s understand decision trees with the help of an example:

 

Day

Weather

Temperature

Humidity

Wind

Play Tennis

D1

Sunny

Hot

High

Weak

No

D2

Sunny

Hot

High

Strong

No

D3

Overcast

Hot

High

Weak

Yes

D4

Rain

Mild

High

Weak

Yes

D5

Rain

Cool

Normal

Weak

Yes

D6

Rain

Cool

Normal

Strong

No

D7

Overcast

Cool

Normal

Strong

Yes

D8

Sunny

Mild

High

Weak

No

D9

Sunny

Cool

Normal

Weak

Yes

D10

Rain

Mild

Normal

Weak

Yes

D11

Sunny

Mild

Normal

Strong

Yes

D12

Overcast

Mild

High

Strong

Yes

D13

Overcast

Hot

Normal

Weak

Yes

D14

Rain

Mild

High

Strong

No

 The above dataset has 9 Yes and 5 No Entries.

We need to find the Information Gain for all the attributes.

Lets first find the Information Gain for the attribute  Outlook

Values (outlook)= Sunny, Overcast, Rain


Lets first find the Information Gain for the attribute Temerature.

Values (Temp) = Hot, Mild, Cool


Attribute: Humidity

Values (Humidity)= High, Normal

Attribute: Wind

Values (Wind)= Weak, Strong











Comments

Popular posts from this blog

Linear Regression

Logistic Regression

k-Nearest Neighbors Algorithm