Question: Problem 2) Threshold-based Classifier There are two classes of data points, where each point is represented by two features (x,y). Assume that there are data

Problem 2) Threshold-based Classifier There are two classes of data points, where each point is represented by two features (x,y). Assume that there are data points in each class: C1={(2, 2), (3, 2), (2, 3)}; C2={(1, 2), (1, 1), (2, 1)} and perform the followings in Python: a) Plot the data points. The data points in class C1 and C2 have to be in two different colors and shapes. Label the axes and add legends as appropriate. b) The code asks the user to enter two thresholds thy and thy. c) Your code calculates and prints the training accuracy based on the selected thresholds. To do so, assume that for any data point (x,y) with x> thx and y> thy, the data point belongs to C1, and to C2 if otherwise. Using this rule and the user-selected thresholds, the code calculates the training accuracy as the number of correctly classified data points over the total number of data points (6 in here). d) The code asks the user to enter a new data point by entering both x and y. e) Plot the new point on the plot in part (a). f) The code determines and prints the class (C1 or C2) of the new data point using the use-provided thresholds. g) The user can enter new data points and the code repeats parts (d)-(f) unless the user writes x' as the input. h) Then the code askes for a new threshold values and starts from part (b) i) Run your code and provide the results using the thresholds that you think are the best choice to get the maximum training accuracy. Problem 2) Threshold-based Classifier There are two classes of data points, where each point is represented by two features (x,y). Assume that there are data points in each class: C1={(2, 2), (3, 2), (2, 3)}; C2={(1, 2), (1, 1), (2, 1)} and perform the followings in Python: a) Plot the data points. The data points in class C1 and C2 have to be in two different colors and shapes. Label the axes and add legends as appropriate. b) The code asks the user to enter two thresholds thy and thy. c) Your code calculates and prints the training accuracy based on the selected thresholds. To do so, assume that for any data point (x,y) with x> thx and y> thy, the data point belongs to C1, and to C2 if otherwise. Using this rule and the user-selected thresholds, the code calculates the training accuracy as the number of correctly classified data points over the total number of data points (6 in here). d) The code asks the user to enter a new data point by entering both x and y. e) Plot the new point on the plot in part (a). f) The code determines and prints the class (C1 or C2) of the new data point using the use-provided thresholds. g) The user can enter new data points and the code repeats parts (d)-(f) unless the user writes x' as the input. h) Then the code askes for a new threshold values and starts from part (b) i) Run your code and provide the results using the thresholds that you think are the best choice to get the maximum training accuracy
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
