Error message referencing instructor code in anomaly detection lab

When testing my code for implementation, I get an error message that references instructor code, not my own.

What part of my code might be causing this?

Hi @AndreaH1

Make sure from your implementation of the value F1 as it’s data type not number, you could check the hint below the code

I checked the hints and I have the correct code but my spacing was more compact (doesn’t usually matter). I changed the spacing anyway, and I still have the same message running the cell. F1 is referring back to precision and recall so I checked those too. My code aligns with the hints.

Very puzzling.

Hello @AndreaH1,

I believe @AbdElRhaman_Fakhry’s key message is about the data type of your F1 (and actually best_F1 too). You need to make sure they are both numbers (not array) as they are supposed to be numbers. You can add some print and type to keep track of the change of their types over the loop.

Note that usually we can google the error message itself, check for its meaning or potential cause, and then think about how to fix it. For example, google this and we will see a list of stackoverflow discussions which even though won’t straightly give away the answer, they provided some discussion around the cause.

Cheers,
Raymond