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.
The text was updated successfully, but these errors were encountered: