I cannot understand why i get an error in the features
So i add a function that check the data
Training Set Checks:
quality_check: labels[0] matches data.quality. Test passed.
is_red_check: labels[1] matches data.is_red. Test passed.
Validation Set Checks:
quality_check: labels[0] matches data.quality. Test passed.
is_red_check: labels[1] matches data.is_red. Test passed.
Test Set Checks:
quality_check: labels[0] matches data.quality. Test passed.
is_red_check: labels[1] matches data.is_red. Test passed.
First 5 ‘is_red’ labels in train_Y: [0 0 0 0 0]
First 5 ‘is_red’ values in train_df: [0 0 0 0 0]
But then
train_Y[0]_check: train_Y[0] is not equal to train.quality. Please check your code.
Expected: True
Result: False
Please open utils.py if you want to see the unit test here.
train_Y[1]_check: train_Y[1] is not equal to train.is_red. Please check your code.
Expected: True
Result: False
Please open utils.py if you want to see the unit test here.
val_Y[0]_check: train_Y[0] is not equal to val.quality. Please check your code.
Expected: True
Result: False
Please open utils.py if you want to see the unit test here.
val_Y[1]_check: train_Y[1] is not equal to val.is_red. Please check your code.
Expected: True
Result: False
Please open utils.py if you want to see the unit test here.
2 Tests passed
4 Tests failed
and this create an error.
Exception Traceback (most recent call last)
in
----> 1 utils.test_format_output(df, train_Y, val_Y, test_Y)
~/work/release/W1_Assignment/utils.py in test_format_output(df, train_Y, val_Y, test_Y)
165 ]
166
→ 167 test_loop(test_cases)
168
169 def test_norm(norm_train_X, norm_val_X, norm_test_X, train, val, test):
~/work/release/W1_Assignment/utils.py in test_loop(test_cases)
25 print(‘\033[92m’, success," Tests passed")
26 print(‘\033[91m’, fails, " Tests failed")
—> 27 raise Exception(“Please check the error messages above.”)
28
29 def test_white_df(white_df):
Exception: Please check the error messages above.
What to do ?