AI4M C2 W1 Autograder failed

Hi,

All the unit tests passed but the autograder only shows 3/4 correct for my assignment. Could you please help out?

Here is my Lab ID wjfdxqar

Thanks

H

Hello,

You need to describe your error here as best as possible so mentors can help you, not all of us have access to Lab from users.

Hi @MrHuanwang,

As @gent.spah mentioned, please share your errors with us, and the output which the autograder gives you, so that we can help you.

Best,
Mubsi

1 Like

I shared lab ID because I saw someone else solved their error this way

I didn’t see any errors from unit test. I didn’t know there is errors produced by autograder. @Mubsi , thanks for pointing it out. I went back and here is what I found

Function "df_train_unskewed.std" in Code Cell UNQ_C1 does not contain the minumum number of expected arguments. We expected 1 arguments.
Code Cell UNQ_C1: Function 'make_standard_normal' is correct.
Code Cell UNQ_C2: Function 'lr_model' is correct.
Code Cell UNQ_C3: Function 'cindex' is correct.
Code Cell UNQ_C4: Function 'add_interactions' is correct. 
If you see many functions being marked as incorrect, try to trace back your steps & identify if there is an incorrect function that is being used in other steps.
This dependency may be the cause of the errors.

This error seems to be complaining about df_train_unskewed.std. In my code, this is how I invoked it df_train_unskewed.std(). Based on pandas manual, the default for std without any arguments is calculating std on the columns, which is what we want here. So it should work without setting any argument explicitly. Did I do anything wrong?

And this is the output from my unit test, which again showed pass

Tmp Train:

    field1  field2
0       1       4
1       2       5
2      10      11 

Tmp Test:

    field1  field2
0       1       4
1       3       6
2      10      11 

Tmp Train After Standard Normal:

      field1    field2
0 -0.845330 -0.774414
1 -0.258557 -0.354556
2  1.103887  1.128970 

Tmp Test After Standard Normal:

      field1    field2
0 -0.845330 -0.774414
1  0.084683 -0.011508
2  1.103887  1.128970 

Training set transformed field1 has mean -7.401486830834377e-17 and standard deviation 1.0000 
Test set transformed, field1 has mean 0.11441332564321975 and standard deviation 0.9749
Skew of training set field1 before transformation: 1.6523167403329906
Skew of training set field1 after transformation: 1.0857243344604632
Skew of test set field1 before transformation: 1.3896361387064917
Skew of test set field1 after transformation: 0.13709698849045696

 All tests passed.

This is the only bug from my only remaining assignment from this entire course. I’d truly appreciate if anyone could help out! Thanks!

Yeah it seems your output is not as expected, could you pass the right argument to the std function so it can calculate the std for columns or as requested. Even thought it might be default in some cases, maybe the unit test is built such as to find the presence of an argument there.

After all your function is not outputting correctly so there is a problem there with probably the std function arguments.

Hi @MrHuanwang,

You didn’t do anything wrong, it is just that, apparently, the autograder is built to check for specific code lines.

Pass in the argument axis=0 for where you are calculating mean and stdev, and hopefully it should work. Let me know if it still doesn’t.

Best,
Mubsi

Thanks. It passed the autograder now!

Hi ,

I am having same issue auto-grader not passing and I have added the ‘axis=0’ parameter .

Lab ID: yyddbyuunnbz

please help.