Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
memory issue of _class_cov #10898
When I was running linear discriminant training, I noticed very high memory usage.
After debugging I found the problem:
covs =  for group in classes: Xg = X[y == group, :] covs.append(np.atleast_2d(_cov(Xg, shrinkage))) return np.average(covs, axis=0, weights=priors)
The problem is that covariance matrices are stored in a list, which is already not necessary since we only need average of those matrices. After that
I think we can simply take the sum in the loop if precision is not a problem.