Question: Problem 2 : Random Forest Classification Assume that a dataset contains two columns that are to be used as features in a decision tree classifier.

Problem 2: Random Forest Classification
Assume that a dataset contains two columns that are to be used as features in a decision tree classifier. These
columns are named x0 and x1. Both features are continuous numerical features. The label is a categorical
variable with two possible values: 0 and 1. The two features are combined (in order) by a VectorAssembler
object to create a column named features.
Suppose that three decision tree classifiers are trained on bootstrap samples drawn from this dataset. Each tree
uses the features column as its input. The contents of the toDebugString attribute of each tree is shown
below.
Tree Model 1
If (feature 0<=3.0)
If (feature 1<=5.0)
Predict: 0.0
Else (feature 1>5.0)
Predict: 1.0
Else (feature 0>3.0)
If (feature 1<=3.0)
Predict: 1.0
Else (feature 1>3.0)
Predict: 0.0
Tree Model 2
If (feature 1<=5.0)
If (feature 1<=3.0)
Predict: 1.0
Else (feature 1>3.0)
Predict: 0.0
Else (feature 1>5.0)
If (feature 0<=2.0)
Predict: 1.0
Else (feature 0>2.0)
Predict: 0.0
Tree Model 3
If (feature 0<=4.0)
If (feature 1<=3.0)
Predict: 0.0
Else (feature 1>3.0)
Predict: 1.0
Else (feature 0>4.0)
If (feature 0<=6.0)
Predict: 1.0
Else (feature 0>6.0)
Predict: 0.0
Consider a new observation for which x0=5.0 and x1=4.0. Use the rules above to determine which of the
two labels each tree model would assign to this observation. Then assume that a random forest is created from
these three trees. Determine the label that the random forest would assign to the new observation. Provide
your answers in the format shown below.
Tree Model 1 Prediction: xxxx
Tree Model 2 Prediction: xxxx
Tree Model 3 Prediction: xxxx
Random Forest Prediction: xxx

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!