In UNQ_C6 of the C1W3 lab assignment, the function arguments are defined to follow the following dimensionality: (num classes, height, width, depth).
However, in test case 3 when running the “compute_class_sens_spec_test” function, it appears that the label and prediction inputs will be singular columns from a dataframe. The test cell fails due to a lack of dimensions on these inputs. Is this a bug? Or should the function be flexible to handle such an input?
Below is an excerpt of the code output of the cell (removing the line that references my exact solution per Discourse guidelines)
----------------------
Test Case 3:
y_test preds_test category
0 1 1 TP
1 1 1 TP
2 0 0 TN
3 0 0 TN
4 0 0 TN
5 0 1 FP
6 0 1 FP
7 0 1 FP
8 0 1 FP
9 1 0 FN
10 1 0 FN
11 1 0 FN
12 1 0 FN
13 1 0 FN
---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
<ipython-input-28-49c4567a99ff> in <module>()
1 ### test cell ex6 - do not modify this test cell
----> 2 compute_class_sens_spec_test(compute_class_sens_spec)
~/work/W3A1/public_tests.py in compute_class_sens_spec_test(target)
446 pred_3 = np.array( [df['preds_test']])
447 label_3 = np.array( [df['y_test']])
--> 448 sensitivity_3, specificity_3 = target(pred_3, label_3, 0)
449 print("\nSensitivity: ", sensitivity_3)
450 print("Specificity: ", specificity_3, "\n")
<ipython-input-27-a26bf38fdec1> in compute_class_sens_spec(pred, label, class_num)
28
29 # true positives
---> 30 tp = *CENSORING MY SOLUTION*
31
32 # true negatives
IndexError: too many indices for array