Having a problem with Exercise 8 - L1 Practice Assignment Week 2

Please be kind enough to point out what mistake I am making in this implementation

Hi @janageeth np.linalg.norm is a e complex function with multiple input parameters (see for example What is the np.linalg.norm() method in NumPy? (educative.io)). Suggest to keep it simple. Use np.abs and np.sum, based on the fomular mentioned above the exercise.

I am still having a problem with implementing
loss = |y - yhat|
Please help me in this regard

where y and yhat are numpy arrays of the same dimension

Hi @janageeth , without disclosing the solution, it is actually exactly as the definition of L1 that is shown just above the exercise. So first you np.abs, and then np.sum. Just give it a go and see if you can get it to work,

I had a little hard time understanding the concept of absolute value. I figured it out now.

Great to hear @janageeth that you figured it out!