C1_W3 assignment : Exercise 6 - compute_class_sens_spec error

Hi

I am getting following error in C1_W3 exercise 6 function .

Lab ID = ngwyftnwxjto

Sensitivity:  0.2857142857142857
Specificity:  0.42857142857142855 

Error: Data-type mismatch for Test Case 1 in variable 0, Got <class 'numpy.ndarray'>  but expected type <class 'numpy.float64'>
Error: Data-type mismatch for Test Case 1 in variable 1, Got <class 'numpy.ndarray'>  but expected type <class 'numpy.float64'>
Error: Wrong shape for Test Case 1 for variable 0.
Error: Wrong shape for Test Case 1 for variable 1.
Error: Wrong output for Test Case 1 for variable in position 0.
Error: Wrong output for Test Case 1 for variable in position 1.
Error: Wrong output for Test Case 2 for variable in position 0.
Error: Wrong output for Test Case 2 for variable in position 1.
 1  Tests passed
 4  Tests failed
---------------------------------------------------------------------------
AssertionError                            Traceback (most recent call last)
<ipython-input-127-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)
    483     ]
    484 
--> 485     multiple_test(test_cases, target)
    486 
    487 

~/work/W3A1/test_utils.py in multiple_test(test_cases, target)
    122         print('\033[92m', success," Tests passed")
    123         print('\033[91m', len(test_cases) - success, " Tests failed")
--> 124         raise AssertionError("Not all tests were passed for {}. Check your equations and avoid using global variables inside the function.".format(target.__name__))
    125 
    126 def multiple_test_get_sub_volume(test_cases, target):

AssertionError: Not all tests were passed for compute_class_sens_spec. Check your equations and avoid using global variables inside the function.

Hi @Bonny_Patel ,

Welcome to the community! This is your first post :slight_smile:

In this exercise it can be very easy to mismatch the operations. If you send me a DM with your code I can take a look at it and provide hints as to what may be wrong.

Juan

@Bonny_Patel ,

I see that you are using & instead of * in the internal operation of the sum. Please change this operator and also, you don’t need any additional parameter on the sum.

Please try this and let me know how it goes.

Finally, please delete your code. Next time you may want to submit your code via Direct Message (click the name of the person and send a Message). It is not allowed to post code in the open threads.

Juan

thank you @Juan_Olano !! that solved the issue.

1 Like

Excellent! I’m glad you were able to move on.

Juan