Week 1 Assignment - Section 5

I’m getting the following results:
Distribution parameters for training split:

{0: {‘bark_days’: params_binomial(n=30.000, p=0.800),
‘ear_head_ratio’: params_uniform(a=0.100, b=0.597),
‘height’: params_gaussian(mu=34.955, sigma=1.477),
‘weight’: params_gaussian(mu=19.916, sigma=0.997)},
1: {‘bark_days’: params_binomial(n=30.000, p=0.497),
‘ear_head_ratio’: params_uniform(a=0.201, b=0.500),
‘height’: params_gaussian(mu=30.041, sigma=1.999),
‘weight’: params_gaussian(mu=24.910, sigma=5.020)},
2: {‘bark_days’: params_binomial(n=30.000, p=0.298),
‘ear_head_ratio’: params_uniform(a=0.101, b=0.300),
‘height’: params_gaussian(mu=40.152, sigma=3.520),
‘weight’: params_gaussian(mu=31.927, sigma=3.045)}}

Probability of each class for training split:

{0: 0.346, 1: 0.393, 2: 0.26}

I should be getting:

Expected Output
Distribution parameters for training split:

{0: {'bark_days': params_binomial(n=30.000, p=0.801),
     'ear_head_ratio': params_uniform(a=0.100, b=0.597),
     'height': params_gaussian(mu=35.030, sigma=1.518),
     'weight': params_gaussian(mu=20.020, sigma=1.012)},
 1: {'bark_days': params_binomial(n=30.000, p=0.498),
     'ear_head_ratio': params_uniform(a=0.201, b=0.500),
     'height': params_gaussian(mu=29.971, sigma=2.010),
     'weight': params_gaussian(mu=24.927, sigma=5.025)},
 2: {'bark_days': params_binomial(n=30.000, p=0.296),
     'ear_head_ratio': params_uniform(a=0.101, b=0.300),
     'height': params_gaussian(mu=39.814, sigma=3.572),
     'weight': params_gaussian(mu=31.841, sigma=3.061)}}

Probability of each class for training split:

{0: 0.346, 1: 0.393, 2: 0.26}

I think this is the cause for why my final accuracy score is only 0.98 instead of 1.00. Is this just a rounding thing that can be ignored or something more significant?

Hi @Ralph_Nussbaumer, it looks to me that your generated data might be slightly different from what the assignment expects. If you want, send me your notebook through a DM and I will take a look.

Hi a-zarta, I figured it out. I was not calling the uniform_generator function from the generator functions further down. I simply used the same code as in the generator functions as I used in uniform_generator. The bolded line from the instructions to be sure use functions defined earlier gave me the hint. I guess the np.random.seed(42) must initialize the data somehow to make it sync with what is expect. Thanks for the offer to help

Ralph

Cool! Indeed that is the reason why we ask to use uniform_generator function.