Project centred row data X onto the first k principal components. components is a matrix whose columns are the component directions, so the retained coordinates are Z=XV[:,:k].
Implement solve(X, components, k).
Returns. Return an n×k NumPy array.
Example 1
Input:
solve([[1, 2], [3, 4]], [[1, 0], [0, 1]], 1)
Output:
[[1], [3]]
Example 2
Input:
solve([[-1, 2]], [[0, 1], [1, 0]], 2)
Output:
[[2, -1]]
No results yet
Run your code to check it against the examples, or submit to run every test.