Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

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

Database And Expert Systems Applications 24th International Conference Dexa 2013 Prague Czech Republic August 2013 Proceedings Part 1 Lncs 8055

Authors: Hendrik Decker ,Lenka Lhotska ,Sebastian Link ,Josef Basl ,A Min Tjoa

2013 Edition

3642402844, 978-3642402845

More Books

Students also viewed these Databases questions

Question

Methods of Delivery Guidelines for

Answered: 1 week ago