I get the exact output as expected, but i fail 2 out of 4 tests. The test description hint to the shape of the output:
Test case “extra_check”. Wrong shape of pred_sklearn output.
Expected: (4, 1).
Got: (3, 1).
Test case “extra_check”. Wrong output of pred_sklearn for X = [-5 0 1 5].
Could somebody point me to the cause for this error?
You have a 2D array and you need to make it with 4 dimensions it says, but you are only making it with 3 dimensions. So you need one more dimensions expansion as far as I can think of.
I just read expected (4, 1) above but I am not familiar with this specialization, thought that might be helpful. Perhaps a mentor of this specialization could have more insight.
Well, for this specific case, I’d say that you connect with mentors.
If the problem is less serious than this, say, problem understanding the process, you may explain it with words. Sometimes, depending upon the situation, you might even ask mathematically.
Now, if the problem is really severe, you should talk with the course lead.
Note: Please refrain from posting your code, as it is against the Honor code.
You did everything correctly except for one thing. Remember that when you write a function with inputs/arguments, you intend to use and process its inputs in order to get an output. In this case, did you use all the inputs? And did you use some variable (e.g. X_pred) which is not the desired input?
I hope this helps. I was trying to answer your question without explicitly giving you the solution.
Let me know if you need further help. You can send me a PM. Thank you.