Question

In: Computer Science

Consider the following dataset where the target feature is “Run”. Weather Mood Breezy Run Hot Mixed...

Consider the following dataset where the target feature is “Run”.
Weather Mood Breezy Run
Hot Mixed feeling No No
Hot Happy Yes Yes
Warm Happy Yes Yes
Warm Sad No Yes
Warm Mixed feeling No No
Hot Happy No No
Cold Happy No Yes
(i) On what feature should you split on first, using Information Gain? 8
(ii) Draw the decision tree at this stage with the above selected root node

Solutions

Expert Solution

(i)

Splitting will based on "Mood" Feature.

Reason using information gain:

Let node N represent or hold the tuples of partition D.

The attribute with the highest information gain is chosen as the splitting attribute for node N.

This attribute minimizes the information needed to classify the tuples in the resulting partitions

and reflects the least randomness or “impurity” in these partitions.

The expected information needed to classify a tuple in D is given by

where p(i) is probability of favourable tuple in class i

The information contained by a particular attribute is Given by

where D(j) is data set containing tuple where particular feature is selected

Gain(A) tells us how much would be gained if we branch on A.

Using the above formulas:

Since 4 tuple are classifying in "yes" case and remaining 3 classifying in "no" case

Now let Attribute as Mood => Happy (4 tuple), Mixed_Feeling (2 tuple), Sad (1 tuple)

Now let Attribute as Weather => Warm(3 tuple), Hot (3 tuple), Cold ( 1 tuple)

Now let Attribute as Breezy => No(5 tuple), Yes(2 tuple)

Hence Gain(Mood) = 0.985 - 0.463 = 0.522 bits

Gain(Weather) = 0.985 -  0.787 = 0.198 bits

Gain(Breezy) = 0.985 - 0.693 = 0.292 bits

=> First splitting should be based on Mood since it is giving highest Gain

After Mood feature selection dataset is divided in 3 sets

Mood = "Happy"

Mood = Happy
Weather Breezy Run
Hot Yes Yes
Warm Yes Yes
Hot No No
Cold No Yes
Mood = Mixed_Feeling
Weather Breezy Run
Hot No No
Warm No No
Mood = Sad
Weather Breezy Run
Warm No Yes

When Mood is Mixed_Feeling outcome is No (No more splitting) , Sad is Yes (No more splitting)
We again need to split remaining database based on other two feature

So Let new dataset = DMH (Data on Mood Happy)

Again we have to do same process to make complete decision tree

(ii)


Related Solutions

Given the following dataset about weather in Melbourne: OUTLOOK TEMPERATURE HUMIDITY WINDY PLAY GOLF Rainy Hot...
Given the following dataset about weather in Melbourne: OUTLOOK TEMPERATURE HUMIDITY WINDY PLAY GOLF Rainy Hot High False No Rainy Hot High True No Overcast Hot High False Yes Sunny Mild High False Yes Sunny Cool Normal False Yes Sunny Cool Normal True No Overcast Cool Normal True Yes Rainy Mild High False No Rainy Cool Normal False Yes Sunny Mild Normal False Yes Rainy Mild Normal True Yes Overcast Mild High True Yes Overcast Hot Normal False Yes Sunny...
Consider the dataset shown below where the decision attribute is restaurant
Consider the dataset shown below where the decision attribute is restaurantShown below is a partially developed decision tree. Finish creating the tree using the ID3 method. YOU WILL NOT RECEIVE ANY CREDIT UNLESS YOU SHOW ALL OF YOUR WORK IN TERMS OF ENTROPY AND INFORMATION GAIN CALCULATIONS!!!
Consider a perfectly competitive market in the short-run with the following demand and supply curves, where...
Consider a perfectly competitive market in the short-run with the following demand and supply curves, where P is in dollars per unit and Q is units per year: Demand: P = 500 – 0.8Q Supply: P = 1.2Q a. Calculate the short-run competitive market equilibrium price and quantity. Graph demand, supply, and indicate the equilibrium price and quantity on the graph. b. Now suppose that the government imposes a price ceiling and sets the price at P = 180. Address...
(THIS IS A MIXTURE OF ALL OF THE FOLLOWING ACIDS AND BASES MIXED TOGETHER WHERE A...
(THIS IS A MIXTURE OF ALL OF THE FOLLOWING ACIDS AND BASES MIXED TOGETHER WHERE A COMBINED pH IS WHAT I AM LOOKING FOR) 1. I have 0.500 Liters of water. To that 0.500 Liters, I add the following: a. 0.100 moles HCl b. 0.100 moles HOAc c. 0.100 moles NH4Cl d. 0.100 moles HF e. 0.050 moles NaOH f. 0.050 moles NaOAc g. 0.050 moles Mg(OH)2 What is the pH of the resulting mixture of everything? Dissociation constants of...
Present—Mixed streams Consider the mixed streams of cash flows shown in the following​ table, a.  Find...
Present—Mixed streams Consider the mixed streams of cash flows shown in the following​ table, a.  Find the present value of each stream using a 6% discount rate. b. Compare the calculated present values and discuss them in light of the undiscounted cash flows totaling ​$80,000 in each case. Is there some discount rate at which the present values of the two streams would be​ equal? year stream a stream b 1 -60,000   20,000 2 50,000   30,000 3 40,000   40,000 4...
Consider the daily market for hot dogs in a small city. Suppose that this market is in long-run competitive equilibrium with many hot dog stands in the city, each one selling the same kind of hot dogs.
 5. Monopoly outcome versus competition outcome Consider the daily market for hot dogs in a small city. Suppose that this market is in long-run competitive equilibrium with many hot dog stands in the city, each one selling the same kind of hot dogs. Therefore, each vendor is a price taker and possesses no market power. The following graph shows the demand (D) and supply (S = MC) curves in the market for hot dogs. Place the black point (plus symbol) on the graph...
Consider the AS-AD model where the economy is not in long-run equilibrium, in particular, assume there...
Consider the AS-AD model where the economy is not in long-run equilibrium, in particular, assume there is a negative output gap (that is, the economy is in a recession). (a) Describe the adjustment under fixed exchange rates if there is no government intervention. (b) Contrast your answer with that under flexible exchange rates
Read the following news items and explain where a short-run decision and a long-run decision are...
Read the following news items and explain where a short-run decision and a long-run decision are involved? a. January 31, 2020: Tim Horton will open 60 more stores in Asian countries   b. March 30, 2020: All stores of Tim Horton will shut down on Tuesday stores so that baristas can receive a refresher course. c. June 2, 2020: Tim Horton replaces baristas with vending machines. d. June 30, 2020: Tim Horton is closing 200 stores in British Columbia by the...
Consider a perfectly competitive market that is currently in a short-run equilibrium, and where each firm...
Consider a perfectly competitive market that is currently in a short-run equilibrium, and where each firm in the market is making strictly positive profits. Each firm in the market is using a technology called the type A technology. Suppose that the type A technology is available in some finite number. Passed some threshold, new firms that would enter the market would have to use the type B technology, a different (and inferior) technology. The type B technology results in a...
Briefly answer the following questions. Consider the followingstatements In a Mixed economy there is only private...
Briefly answer the following questions. Consider the followingstatements In a Mixed economy there is only private ownership of means of production In a communist nation, the means of production are owned by the state In a free-market economy there is minimum role of the government. Which of the above three statements is/are true? b. Answer the following: Who is credited with bringing the term the ‘’invisible hand’’ in economics? And what it means? Why intermediate goods are not included to...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT