Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Professor John Doe has developed a novel classification algorithm (model) for diagnosing early onset of lung cancer. Dr. Doe has collected data from 1000
Professor John Doe has developed a novel classification algorithm (model) for diagnosing early onset of lung cancer. Dr. Doe has collected data from 1000 participants with half of them diagnosed with lung cancer and half of them do not have lung cancer. To test the effectiveness of his algorithm he has two sets of data: A vector named y_original that has values of 0's and 1's where 0 means "does not have lung cancer" and 1 means "has lung cancer". These are values with correct outcomes for the 1000 patients. b. A vector of data named y_predicted. Using his prediction model, he has generated the y_predicted vector of 1000 values that also contain 0's and 1's. These are the predicted outcomes of the same 1000 patients. a. Dr. Doe is interested in knowing if his prediction model is comparable to the existing prediction models by computing some performance measures, so he hires you in his lab to work on this problem. Your task is to use the data provided above to determine the following values: 1. True positives (TP): A true positive is an outcome where the model correctly predicts the positive outcome. For example, if y_original (i) is 1 and y_predicted (i) is also 1 then we have a true positive. False positives (FP): A false positive is an outcome where the model incorrectly predicts the positive outcome. For example, if y_original (i) is 0 but y_predicted (i) is 1 then we have a false positive. 3. False negatives (FN): A false negative is an outcome where the model incorrectly predicts the negative outcome. For example, if y_original (i) is 1 but y_predicted (i) is 0 then we have a false negative. 2. True negatives (TN): A true negative is an outcome where the model correctly predicts the negative outcome. For example, if y_original (i) is 0 and y_predicted (i) is also 0 then we have a true negative. 'i' refers to the ith element in the vectors. 4. Your task is to write a program that compares the two vectors to get a total number of TPs, FPs, FNs and TNs. While each of the above values could be calculated using a single line of code, you MUST use a loop (for or while), and some if and' elseif statements to compute them.
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