I am trying to solve the UNQ_C4, but I am not able to do it.

I solved the UNQ_C3 and when trying to generalize that solution for the multiple classes I am not succeeding, I have really looked for documentation on how to program this and I have not found it, and during the course no examples were given, that is why I am blocked at this moment and I can’t continue with this last lab.

Could someone give me some indication of where to look for possible solutions on how to implement this?

The result I am getting is the following:

Test Case 1:

Pred:

[[1. 0.]

[0. 1.]]

Label:

[[1. 1.]

[0. 0.]]

Dice coefficient: 0.6805555555555556

Test Case 2:

Pred:

[[1. 0.]

[0. 1.]]

Label:

[[1. 1.]

[0. 1.]]

Dice coefficient: 0.875

Test Case 3:

Pred:

class = 0

[[1. 0.]

[0. 1.]]

class = 1

[[1. 0.]

[0. 1.]]

Label:

class = 0

[[1. 1.]

[0. 0.]]

class = 1

[[1. 1.]

[0. 1.]]

Dice coefficient: 0.7777777777777777

Error: Wrong output for Test Case 1. One possible reason for error: make sure epsilon = 1

Error: Wrong output for Test Case 2. One possible reason for error: make sure epsilon = 1

Error: Wrong output for Test Case 3. One possible reason for error: make sure epsilon = 1

4 Tests passed

3 Tests failed

And the expected result is:

#### Expected output:

Test Case 1:

Pred:

[[1. 0.]

[0. 1.]]

Label:

[[1. 1.]

[0. 0.]]

Dice coefficient: 0.6

Test Case 2:

Pred:

[[1. 0.]

[0. 1.]]

Label:

[[1. 1.]

[0. 1.]]

Dice coefficient: 0.8333333333333334

Test Case 3:

Pred:

class = 0

[[1. 0.]

[0. 1.]]

class = 1

[[1. 0.]

[0. 1.]]

Label:

class = 0

[[1. 1.]

[0. 0.]]

class = 1

[[1. 1.]

[0. 1.]]

Dice coefficient: 0.7166666666666667