I have a set of data that consists of over 1000 data points and each has 7 features. Basically, a (1000, 7) shaped data. By using it's covariance matrix, I want to calculate
X * Covariance * X and I want the result to be a size of (1000,)
If I do a loop over all X one by one, I can reach this result but is there a way that I can do using this data set as a whole? I am using numpy only.
X.T.dot(np.linalg.inv(covariance)).dot(X)
This is what I have right now. As I said I can do it by looping over all the X's but I want to do it without the loop. Is it possible? If so, how?