M4ML C3_w1 Exercise 6 Def prob_of_X_given_C : probability *=None

C3_w1 def prob_of_X_given_C(X, features, breed, params_dict):

Hello
I am struggling with the last line of the code:
probability *= None

Any inputs appreciated.
I tried setting it equal to a number of variables (probability_f, feature_val, etc) but none have worked.
Thank you

Hi @alison_barbi!

The notation A *= B in python is the same thing as A = A*B. It is the same fashion as A += 1 where it means A = A + 1. So this implies that the Nonevalue should be the value that you must update the probability.

Tell me if you need any further help.

Cheers,
Lucas

Thank you Lucas.
I do need more help.
I am not getting the correct output and the grader is giving the function 7/10 pts.
Perhaps I am not accessing the parameters incorrectly?
I will not paste code but this is how I am accessing the
params_dict:
each in brackets: breed feature_name ‘mu’ (or other ).
Your feedback is deeply appreciated.
Alison

this is the output:
Example dog has breed 1 and features: height = 28.63, weight = 21.56, bark_days = 13.00, ear_head_ratio = 0.27

Probability of these features if dog is classified as breed 0: 8.751901274577668e-11
Probability of these features if dog is classified as breed 1: 0.01176073212139429
Probability of these features if dog is classified as breed 2: 0.0

This is the expected:

xpected Output
Example dog has breed 1 and features: height = 28.63, weight = 21.56, bark_days = 13.00, ear_head_ratio = 0.27

Probability of these features if dog is classified as breed 0: 6.989632718589114e-11
Probability of these features if dog is classified as breed 1: 0.0038267778327024894
Probability of these features if dog is classified as breed 2: 7.959172138800559e-08