Hello! I hope you are doing well.
This query is about C3 W1 A1 Ex 6: prob_of_X_given_C.
We have given that you just need to compute the appropriate PDF
for each feature by passing the estimated parameters of that feature to the corresponding PDF
computation function.
Code structure is:
### START CODE HERE ###
for None, None in zip(None, None):
# Get the relevant parameters from params_dict
params = params_dict[None][None]
match None:
# You can add add as many case statements as you see fit
case "height" | "weight":
# Compute the relevant pdf given the distribution and the estimated parameters
probability_f = None(None, None, None)
- I did x and feature in zip of X and features.
- I used breed and feature for [None][None] of
params_dict
For the case of height or weight, I am using the Gaussian PDF
which takes the x, mu, and sigma as the argument. So, my question is, how to pass the mu
and sigma
?
I print out the params_dict
but didn’t get any hint:
params_dict: {2: {'height': Index(['height', 'weight', 'bark_days', 'ear_head_ratio'], dtype='object'), 'weight': Index(['height', 'weight', 'bark_days', 'ear_head_ratio'], dtype='object'), 'bark_days': Index(['height', 'weight', 'bark_days', 'ear_head_ratio'], dtype='object'), 'ear_head_ratio': Index(['height', 'weight', 'bark_days', 'ear_head_ratio'], dtype='object')}, 0: {'height': Index(['height', 'weight', 'bark_days', 'ear_head_ratio'], dtype='object'), 'weight': Index(['height', 'weight', 'bark_days', 'ear_head_ratio'], dtype='object'), 'bark_days': Index(['height', 'weight', 'bark_days', 'ear_head_ratio'], dtype='object'), 'ear_head_ratio': Index(['height', 'weight', 'bark_days', 'ear_head_ratio'], dtype='object')}, 1: {'height': Index(['height', 'weight', 'bark_days', 'ear_head_ratio'], dtype='object'), 'weight': Index(['height', 'weight', 'bark_days', 'ear_head_ratio'], dtype='object'), 'bark_days': Index(['height', 'weight', 'bark_days', 'ear_head_ratio'], dtype='object'), 'ear_head_ratio': Index(['height', 'weight', 'bark_days', 'ear_head_ratio'], dtype='object')}}
Your guidance is highly appreciated.
Best,
Saif.