Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2018 Dublin Ireland September 10 14 2018 Proceedings Part 1 Lnai 11051

Authors: Michele Berlingerio ,Francesco Bonchi ,Thomas Gartner ,Neil Hurley ,Georgiana Ifrim

1st Edition

3030109240, 978-3030109240

More Books

Students also viewed these Databases questions

Question

What are the stages of project management? Write it in items.

Answered: 1 week ago

Question

why do consumers often fail to seek out higher yields on deposits ?

Answered: 1 week ago