Join Our 5-Week ML/AI Engineer Interview Bootcamp 🚀 led by ML Tech Leads at FAANGs
Orthogonality is a core linear-algebra concept used in ML to detect independence, remove redundancy, and measure similarity. In this task, you’ll implement a simple orthogonality checker for two vectors using the dot product.
Implement the function:
Rules:
tol to handle floating-point error: return True if abs(dot) <= tol.Output:
| Argument | Type |
|---|---|
| x | np.ndarray |
| y | np.ndarray |
| tol | float |
| Return Name | Type |
|---|---|
| value | bool |
Use NumPy; no similarity/distance helpers
Return boolean; no printing
Use tolerance: abs(dot) <= tol
Orthogonality means the dot product is zero: compute (\sum_i x_i y_i).
Use np.dot(x, y) to get the dot product.
Use tolerance for floating-point error: return abs(dot_val) <= tol.