Answered step by step
Verified Expert Solution
Question
1 Approved Answer
5 (20 points) Decision Stump In this problem, we will perform a binary classification task on a modified Iris dataset. This modified Iris dataset has
5 (20 points) Decision Stump In this problem, we will perform a binary classification task on a modified Iris dataset. This modified Iris dataset has 2 classes and it is split into a training set Straining with 100 data points and a test set Stest with 50 data points. Each data point (x,y) has a feature vector XER4 and its corresponding label y E {0,1}. Here we utilize a decision stump to solve the above binary classification task. The decision stump works as follows (for simplicity, we restrict our attention to uni-directional decision stumps): Given the feature vector x, the feature index j, and a threshold Th, the classification function is defined by y = f(x, j, Th) as: i if x(j) > Th f(x, j, Th) = { 0 otherwise. where x(j) refers to the j-th feature in x. The error e on dataset S = {(xi, yi)} is defined as: =- 1(Yi+ f(xi, j, Th)) n i=1 where n = |S| is the size of the dataset S. Thus, we can obtain training error etraining on training set Straining, and test error etest on test set Stest - Based on the decision stump above, we wish to use an algorithm to find the best feature index j* and the best threshold Th* on training set to create a "best" decision stump, in a sense that such decision stump can achieve the lowest training error e training Please download the notebook decision stump.ipynb from the course website and fill in the missing blanks. Follow the instructions in the skeleton code and report: The best feature index, the best threshold, the lowest training error and its correspond- ing test error. All 4 histograms. 5 (20 points) Decision Stump In this problem, we will perform a binary classification task on a modified Iris dataset. This modified Iris dataset has 2 classes and it is split into a training set Straining with 100 data points and a test set Stest with 50 data points. Each data point (x,y) has a feature vector XER4 and its corresponding label y E {0,1}. Here we utilize a decision stump to solve the above binary classification task. The decision stump works as follows (for simplicity, we restrict our attention to uni-directional decision stumps): Given the feature vector x, the feature index j, and a threshold Th, the classification function is defined by y = f(x, j, Th) as: i if x(j) > Th f(x, j, Th) = { 0 otherwise. where x(j) refers to the j-th feature in x. The error e on dataset S = {(xi, yi)} is defined as: =- 1(Yi+ f(xi, j, Th)) n i=1 where n = |S| is the size of the dataset S. Thus, we can obtain training error etraining on training set Straining, and test error etest on test set Stest - Based on the decision stump above, we wish to use an algorithm to find the best feature index j* and the best threshold Th* on training set to create a "best" decision stump, in a sense that such decision stump can achieve the lowest training error e training Please download the notebook decision stump.ipynb from the course website and fill in the missing blanks. Follow the instructions in the skeleton code and report: The best feature index, the best threshold, the lowest training error and its correspond- ing test error. All 4 histograms
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started