Join Our 5-Week ML/AI Engineer Interview Bootcamp 🚀 led by ML Tech Leads at FAANGs
Vector multiplication is a core linear algebra operation used in ML for computing projections and model scores. In this task, you’ll implement the dot product of two vectors.
The dot product is defined as:
Implement the function
Rules:
x and y.numpy.dot, @, numpy.matmul).*) and summation (sum).Output:
| Argument | Type |
|---|---|
| x | np.ndarray |
| y | np.ndarray |
| Return Name | Type |
|---|---|
| value | float |
No numpy.dot/@/matmul allowed
Return a single float result
Keep solution inside dot_product()
This can be done with elementwise multiplication x * y followed by np.sum(...).
Ensure you return a native python float, e.g. float(np.sum(...)).