Highly Confused After Plenty of Work - Classification Error1

Hello guys,

I am Menelaos from Greece.

After plenty of studying, notes’ preparations and mental clarity I re-enrolled on Sunday in Course 2 of Advanced Learning Algorithms.

Today I managed to reach Week 3 of the graded Labs having reached almost in the middle.

My issue is the highly intuitive formulas of the graded cell eval_cat_err.

I have attached screenshots of how I thought of it but I’m still confused. We have to calculate a branched sum trying to figure out how many times predictions are identical and how many times they differ. The sum of the constant 1 from 0 to (m-1) equals 1*m. So we could say that they differ (m-TruePositives) times and they’re identical (TruePositives) times. But that’s just theory cos calculations and variables differ, it’s just theory help.

If they differ (yhat - y) is not 0. If they’re identical, as indices, (yhat-y) is 0. Or we can use the fraction of (yhat/y) to decide, meaning, being 1 or not 1. We’re talking multiclass classification and we have to discover a mechanical analogy of the computations that gives us the exact proportions. I’m dazzled and can’t figure out the equations.

Can someone, instructor or mentor who knows the problem guide me to how am I supposed to pass it? I would truly appreciate an not on-the-go answer.

Looking forward to hearing from you
Best
M

{mentor edit: code image removed}

First tip:
I see the “execution count” number (inside the square brackets) is 281 cells run since you last restarted the kernel.

I recommend you restart the kernel (use “Kernel->Restart & Clear All output”), and then run all of the cells in sequence starting from the top.

This will guarantee your notebook workspace doesn’t include any old data.

2nd tip:
Your code for “incorrect = …” is way too complicated. All you need to do is increment the 'incorrect" value by 1.

And you do not need any “else” clause there.

3rd tip:
Just before the return statement, you set cerr to the incorrect count, scaled by 1/m.

Hello TMosh,

Thanks for the support. Exercise passed.

I sent you 2 times one last email from Week 3, but I still can’t find it in the platform as a record. Have you received it? Should I send it to you again?

Is there possible another way for private messages?

I would appreciate your timely response
Best
M